This commit is contained in:
hwdsl2 2021-09-07 09:02:22 -05:00
parent e83526e213
commit 263ffe97cc
10 changed files with 13 additions and 13 deletions

View File

@ -19,7 +19,7 @@ conf_bk() { /bin/cp -f "$1" "$1.old-$SYS_DT" 2>/dev/null; }
add_vpn_user() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
if ! grep -qs "hwdsl2 VPN script" /etc/sysctl.conf \
@ -38,8 +38,8 @@ VPN_PASSWORD=$2
if [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then
cat 1>&2 <<EOF
Usage: sudo sh $0 'username_to_add' 'password'
sudo sh $0 'username_to_update' 'new_password'
Usage: sudo bash $0 'username_to_add' 'password'
sudo bash $0 'username_to_update' 'new_password'
EOF
exit 1
fi

View File

@ -19,7 +19,7 @@ conf_bk() { /bin/cp -f "$1" "$1.old-$SYS_DT" 2>/dev/null; }
del_vpn_user() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
if ! grep -qs "hwdsl2 VPN script" /etc/sysctl.conf \
@ -35,7 +35,7 @@ VPN_USER=$1
if [ -z "$VPN_USER" ]; then
cat 1>&2 <<EOF
Usage: sudo sh $0 'username_to_delete'
Usage: sudo bash $0 'username_to_delete'
EOF
exit 1
fi

View File

@ -41,7 +41,7 @@ noquotes2() { printf '%s' "$1" | sed -e 's/" "/ /g' -e "s/' '/ /g"; }
update_vpn_users() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
if ! grep -qs "hwdsl2 VPN script" /etc/sysctl.conf \

View File

@ -25,7 +25,7 @@ bigecho() { echo "## $1"; }
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -27,7 +27,7 @@ bigecho() { echo "## $1"; }
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -27,7 +27,7 @@ bigecho() { echo "## $1"; }
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -27,7 +27,7 @@ bigecho() { echo "## $1"; }
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -48,7 +48,7 @@ check_ip() {
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -49,7 +49,7 @@ check_ip() {
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}

View File

@ -49,7 +49,7 @@ check_ip() {
check_root() {
if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
exiterr "Script must be run as root. Try 'sudo bash $0'"
fi
}