Just updated the code... I get out everytime on the "else" sequence. You can download the update.sh file from my server. it only contains echo "Hallo update"
Updated code (03.11.2015)
#/bin/bash
updateoldmd5=`sed -n l globalupdate.aix`
updatenewmd5=`md5sum update.sh |cut -d ' ' -f 1`
if [ $updateoldmd5 = $updatenewmd5 ]
then
apt-get update
echo -e $(date) "Nothing to update on this System($(hostname))." >> globalupdate.log
wget --no-check-certificate http://aixcrypt.com/vpnprofiles/services/cis/update.sh -O /root/update.sh
echo "Done"
else
chmod +x /root/update.sh
./root/update.sh
echo -e $(date) "System ($(hostname)) Updated." >> globalupdate.log
echo ""
md5sum update.sh |cut -d ' ' -f 1 > globalupdate.aix
echo "Update done"
#Get new update.sh file for next update check of the node system.
wget --no-check-certificate http://aixcrypt.com/vpnprofiles/services/cis/update.sh -O /root/update.sh
fi
Just for your notice. The globalupdate.aix file only contains the MDsum of the previous update.sh file, to compare against the new downloaded one (To check if any changes do apply on the systems). This script is about to depoly the same update.sh file to a buch of debian servers...