diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-12-12 11:17:42 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-12-12 11:17:42 -0200 |
commit | 103334fc729de2c982c83b4886faad40ff5e32ce (patch) | |
tree | 99b43529ce1bfeb9a89dcb28f848198b9b0d199b /share/hydractl/upgrade | |
parent | 7acd4c75e218e7cb5781af91f92b03c323770cbb (diff) | |
download | hydra-103334fc729de2c982c83b4886faad40ff5e32ce.tar.gz hydra-103334fc729de2c982c83b4886faad40ff5e32ce.tar.bz2 |
Adding chroot-upgrade and clean option to upgrade
Diffstat (limited to 'share/hydractl/upgrade')
-rwxr-xr-x | share/hydractl/upgrade | 9 |
1 files changed, 9 insertions, 0 deletions
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 |