diff --git a/tun.sh b/tun.sh index 0c46eb5681c0cea838acfee432e5d2169fb2ead1..8528036289dcd19a938dbe16abb4eac644c1de0a 100644 --- a/tun.sh +++ b/tun.sh @@ -53,10 +53,7 @@ check_tun () { } check_sudo () { - if [ "$SUDO_USER" = "root" ]; then - echo "please execute this script as a regular user, not as root" - exit 1 - fi + if [ -z "$SUDO_USER" ]; then # if the user didn't call us with sudo, re-execute exec sudo $0 "$MODE" "$@"