Cleanup
This commit is contained in:
parent
e83526e213
commit
263ffe97cc
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 \
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user