1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #!/bin/sh
- # This file is part of UPMS.
- # Copyright (c) 2016 ali abdul ghani <blade.vp2020@gmail.com>
- # UPMS is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- # UPMS is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
-
- # You should have received a copy of the GNU General Public License
- # along with UPMS. If not, see <http://www.gnu.org/licenses/>.
- updatey() {
- if test $# = 0
- then
- apt-get -y update && apt-get -y upgrade
- else
- apt-get -y install $1
- fi
- }
- yes() {
- if test "$1" = "install"
- then
- 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 $1
- fi
- }
- if test "$1" = "install"
- then
- 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" = "-y"
- then
- updatey $2 $3
- elif test "$1" = "remove"
- then
- apt-get purge $2
- else
- echo E: Invalid operation $1
- fi
|