Fix update scripts from test branch

This commit is contained in:
Orazio 2019-12-30 11:44:33 +01:00
parent a6087f8bda
commit 41984e5f40
4 changed files with 32 additions and 16 deletions

View file

@ -4,8 +4,8 @@ _pivpn()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
dashopts="-a -c -d -l -qr -r -h -u"
opts="add clients debug list qrcode remove help uninstall"
dashopts="-a -c -d -l -qr -r -h -u -up"
opts="add clients debug list qrcode remove help uninstall update"
if [ "${#COMP_WORDS[@]}" -eq 2 ]
then
if [[ ${cur} == -* ]] ; then

View file

@ -48,6 +48,12 @@ uninstallServer(){
exit 0
}
updateScripts(){
shift
$SUDO /opt/pivpn/update.sh "$@"
exit 0
}
showHelp(){
echo "::: Control all PiVPN specific functions!"
echo ":::"
@ -62,6 +68,7 @@ showHelp(){
echo "::: -r, remove Remove a client"
echo "::: -h, help Show this help dialog"
echo "::: -u, uninstall Uninstall pivpn from your system!"
echo "::: -up, update Updates PiVPN Scripts"
exit 0
}
@ -79,5 +86,6 @@ case "$1" in
"-r" | "remove" ) removeClient "$@";;
"-h" | "help" ) showHelp;;
"-u" | "uninstall" ) uninstallServer;;
"-up" | "update" ) updateScripts "$@" ;;
* ) showHelp;;
esac