#!/bin/sh #=============================================================================================================================================== # # Programm : DynIP Checker # Datei : CheckDynIP.sh # Version : 1.0 # Beschreibung : Dynamische IP Adresse prüfen # #------------------------------------------------------------------------ # # Autor : Michael Kleger, OneSystems # Datum : 20.09.2019 --> Erstelldatum # #=============================================================================================================================================== if [ ! -f ~/.DynIP ]; then touch ~/.DynIP fi #----------------------------------------------------------------------------------------------------------------------------------------------- # Konfiguration #----------------------------------------------------------------------------------------------------------------------------------------------- LocIP=`cat ~/.DynIP` DynIP=$(curl -s tools.mail.town) FromMail="support@mail.town" AdminMail="ich@mail.town" #----------------------------------------------------------------------------------------------------------------------------------------------- # Script #----------------------------------------------------------------------------------------------------------------------------------------------- if [ "$LocIP" != "${DynIP}" ]; then # Mail versenden if [ -a /usr/sbin/sendmail ]; then /usr/sbin/sendmail "$AdminMail" < ~/.DynIP fi