From 103334fc729de2c982c83b4886faad40ff5e32ce Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 12 Dec 2013 11:17:42 -0200 Subject: Adding chroot-upgrade and clean option to upgrade --- share/hydractl/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'share/hydractl/upgrade') diff --git a/share/hydractl/upgrade b/share/hydractl/upgrade index cc3e985..d0ccde9 100755 --- a/share/hydractl/upgrade +++ b/share/hydractl/upgrade @@ -21,9 +21,18 @@ if [ "`whoami`" != 'root' ]; then sudo="sudo" fi +# Issue upgrade if ! $sudo lsof /var/lib/dpkg/lock &> /dev/null; then $sudo aptitude update $sudo aptitude safe-upgrade -y else echo "Apt is locked, aborting." fi + +# Upgrade all chroots +hydractl chroot-upgrade + +# Cleanup +if [ "$2" == "clean" ]; then + $sudo aptitude clean +fi -- cgit v1.2.3