1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #!/bin/bash
- updatey() {
- if test $# = 0
- then
- apt-get -y update && apt-get -y upgrade
- else
- apt-get -y install $@
- fi
- }
- yes() {
- if test "$1" = "install"
- then
- apt-get -y install ${@:2}
- elif test "$1" = "install"
- then
- apt-get -y purge ${@:2}
- apt-get -y install ${@:2}
- elif test "$1" = "upgrade"
- then
- updatey ${@:2}
-
- elif test "$1" = "remove"
- then
- apt-get -y purge ${@:2}
- else
- echo E: Invalid operation $1
- fi
- }
- update() {
- if test $# = 0
- then
- apt-get update && apt-get upgrade
- else
- apt-get install $@
- fi
- }
- if test "$2" = "-y"
- then
- yes $1 ${@:3}
- exit
- fi
- if test "$1" = "install"
- then
- apt-get install ${@:2}
- elif test "$1" = "reinstall"
- then
- apt-get purge ${@:2}
- apt-get install ${@:2}
- elif test "$1" = "autoremove"
- then
- apt-get autoremove
- elif test "$1" = "upgrade"
- then
- update $2
- elif test "$1" = "info"
- then
- apt-cache show $2
- elif test "$1" = "remove"
- then
- apt-get purge ${@:2}
-
- else
- echo E: Invalid operation $1
- fi
|