Browse Source

apt_upgrade: add -y support

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 10 years ago
parent
commit
61dfe6de20
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      files/bin/apt_upgrade

+ 11
- 1
files/bin/apt_upgrade

@ -1,3 +1,13 @@
#!/bin/sh
exec sudo sh -c 'apt-get update && apt-get dist-upgrade && apt-get autoremove --purge'
apt_opt=
if [ $# -eq 0 ]; then
: # interactive
elif [ "${1:-}" = "-y" ]; then
apt_opt="-y"
shift
fi
aptget="apt-get${apt_opt:+ $apt_opt}"
cmd="$aptget update && $aptget dist-upgrade && $aptget autoremove --purge"
exec sudo sh -c "$cmd"

Loading…
Cancel
Save