Jump to content

Ubuntu update


Recommended Posts

And, some modification with status update email.


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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...