File: //proc/self/root/bin/update-display
#!/bin/bash
######
#
#
# Script to update Motd
#
#
######
echo;
echo -e "\e[32mChecking if updates are available\e[39m";
echo;
echo -e "Please wait ...";
sleep 3
wget -O /tmp/motd.new_version http://techdata.mirror.globo.tech/scripts/motd-centos/update/motd.new_version >/dev/null 2>&1
actual_version=`cat /etc/motd.d/motd.version`
new_version=`cat /tmp/motd.new_version`
if [ "${actual_version}" -eq "${new_version}" ]
then
echo -e "\e[32mYou are running the latest version\e[39m";
echo;
else
wget -O /tmp/update-motd.sh http://techdata.mirror.globo.tech/scripts/motd-centos/update/update-motd.sh >/dev/null 2>&1
echo;
echo -e "\e[32mUpgrade in progress\e[39m";
echo;
chmod +x /tmp/update-motd.sh
sh /tmp/update-motd.sh
rm -rf /tmp/update-motd.sh
fi
rm -rf /tmp/motd.new_version
echo "Redirecting ...";
sleep 3
/etc/motd.d/motd.sh
######
#
# End update Motd Script
#
######