I wrote a simple script for unattended-upgrade, which is run when an
interface (except loopback) is coming up.
It is modified from ntpdate in the same directory (/etc/network/if-up.d/).
Here it is:
----8<----8<----8<----8<----8<----8<----8<----
#!/bin/sh
# written by Leander Jedamus 24.09.2012
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
# gives me German messages
LANG=de_DE.utf8
export LANG
# Check whether unattended-upgrade was removed but not purged; it's
useless to
# wait for it in that case.
if [ ! -x $PROGRAM1 ] && [ -d $PROGRAMPATH ]; then
exit 0
fi
if [ ! -x $PROGRAM2 ] && [ -d $PROGRAMPATH ]; then
exit 0
fi
(
# This is for the case that /usr will be mounted later.
if [ -r /lib/udev/hotplug.functions ]; then
. /lib/udev/hotplug.functions
wait_for_file $PROGRAM1
wait_for_file $PROGRAM2
fi
LOCKFILE=/var/lock/$SCRIPTNAME-ifup
# Avoid running more than one at a time
if [ -x /usr/bin/lockfile-create ]; then
lockfile-create $LOCKFILE
lockfile-touch $LOCKFILE &
LOCKTOUCHPID="$!"
fi
This script will run apt-get install as root until it succeeds running
and then will run unattended-upgrade.
Logfile is in /var/log/unattended-upgrades/unattended-upgrades.log
I also wrote to the author of unattended-upgrade, but he has not
answered me for a week or so.
Perhaps somebody else can use it.
Greetings
Leander Jedamus
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
09-24-2012, 01:26 PM
Leander Jedamus
unattended-upgrade in /etc/network/if-up.d
Hi!
I pasted it to http://paste.ubuntu.com/1224477/
Greetings
Leander Jedamus
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users