PDA

View Full Version : Updates on shutdown



shark1997
April 8th, 2010, 12:47 AM
How would I change the shutdown script to allow for automatic updates on shutdown? Would i use bash?

Thanks in advance

--------------------
Ubuntu is awesome

tookyourtime
April 8th, 2010, 01:40 AM
I think from this post (http://ubuntuforums.org/showthread.php?t=185261) you can run a bash script on shutdown as described.

Your script would look something like this:


echo yourpassword | sudo -S apt-get -y update
echo yourpassword | sudo -S apt-get -y dist-upgrade


Someone else will have to help with using sudo in a script without having the password in the file.

jflaker
April 8th, 2010, 01:42 AM
echo yourpassword | sudo -S apt-get -y update&&echo yourpassword | sudo -S apt-get -y dist-upgrade

make it a one liner