Posted October 6, 20168 yr Hi, maybe this is too simple but I'm using for my Ubuntu machine update. Just in case, somebody who also need like me. #!/bin/bash /usr/bin/apt-get -qy update > /dev/null /usr/bin/apt-get -qy dist-upgrade > /dev/null exit 0
October 11, 20168 yr Author And, some modification with status update email. #!/bin/bash tmpfile=$( /bin/mktemp -t ) from= xxx@xxxx.xxx to= yyy@yyyy.yyy /bin/echo return-path: $to >> $tmpfile /bin/echo for: $to >> $tmpfile /bin/echo from: $from >> $tmpfile /bin/echo to: $to >> $tmpfile /bin/echo subject: Ubuntu Update Pulseway Script Status >> $tmpfile /bin/echo Message: >> $tmpfile /bin/echo >> $tmpfile /bin/echo APT-GET Update was run: $( /bin/date +%c ) >> $tmpfile /bin/echo >> $tmpfile /bin/echo -n "Result: " >> $tmpfile /usr/bin/apt-get -qy update > /dev/null /usr/bin/apt-get -qy dist-upgrade | grep -i installed >> $tmpfile /bin/echo >> $tmpfile /bin/cat $tmpfile | sendmail -t /bin/rm $tmpfile exit 0
Create an account or sign in to comment