diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-07-24 10:34:35 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-07-24 10:34:35 -0300 |
commit | 2a8dab4cb169a79ce511832f167117e60f278485 (patch) | |
tree | 127611d0329418f6ea1a2c1d9a75775f2aec1274 | |
parent | 69441f525dde047ac67d476ede715ed38ac2671f (diff) | |
download | hydra-2a8dab4cb169a79ce511832f167117e60f278485.tar.gz hydra-2a8dab4cb169a79ce511832f167117e60f278485.tar.bz2 |
Enhancing hydractl upgrade
-rwxr-xr-x | share/hydractl/upgrade | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/share/hydractl/upgrade b/share/hydractl/upgrade index 81c38ae..7b7d4b5 100755 --- a/share/hydractl/upgrade +++ b/share/hydractl/upgrade @@ -16,4 +16,15 @@ # License along with this program. If not, see # <http://www.gnu.org/licenses/>. -aptitude safe-upgrade -y +# Set sudo config +local sudo device rsync +if [ "`whoami`" != 'root' ]; then + sudo="sudo" +fi + +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 |