From 0d40ac2460b0bd91f94d278714b59489d533e286 Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 18 Dec 2019 14:25:48 +0100 Subject: [PATCH] Update wireguard-install.sh --- wireguard-install.sh | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 82e6f12..26bfa79 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -30,36 +30,6 @@ usage () echo "-h: Show help" } -parse_args () -{ - while [ $# -ne 0 ] - do - case "${1}" in - -install) - shift - arg_install_wg >&2 - ;; - -remove) - shift - remove_wg >&2 - ;; - -h|--help) - usage - exit 0 - ;; - *) - echo "Invalid argument : ${1}" >&2 - usage >&2 - exit 1 - ;; - esac - shift - done - -} - -parse_args "$@" - detect_bad(){ if [ "$(systemd-detect-virt)" == "openvz" ]; then echo "OpenVZ is not supported" @@ -274,3 +244,33 @@ options install_wg configure_wg } + +parse_args () +{ + while [ $# -ne 0 ] + do + case "${1}" in + -install) + shift + arg_install_wg >&2 + ;; + -remove) + shift + remove_wg >&2 + ;; + -h|--help) + usage + exit 0 + ;; + *) + echo "Invalid argument : ${1}" >&2 + usage >&2 + exit 1 + ;; + esac + shift + done + +} + +parse_args "$@"