Mein Code war doch Teststadium.
Mir war schlicht nicht klar, wie ich das curl in eine Variable packe. Da musste ich halt alles mal reinhauen und den Output testen.
Code:
curl -s "http://ipecho.net/plain" -o /volume1/family/new-ip.txt
to="dey@mail.de";
subject="Neue IP by php mail";
body=$(</volume1/family/new-ip.txt)
header=$(</volume1/family/old-ip.txt)
if ! cmp -s /volume1/family/old-ip.txt /volume1/family/new-ip.txt ; then
/usr/bin/php -r "mail('$to', '$subject', '$body', '$header');";
cp /volume1/family/new-ip.txt /volume1/family/old-ip.txt
fi
Aktuell lasse ich das jetzt mal alle 3h laufen und schaue mal, was sich so tut.
Ich habe nur mehrere Domain aber keinen php-space mehr. Somit geht das nicht.
Synology DDNS bekomme ich nicht auf meine Sub.Domain gesynct. Authentification failed. Diese Alternative werde ich aber erst mal nicht mehr verfolgen.