diff --git a/wireguard-install.sh b/wireguard-install.sh index d47e6f4..dc635b9 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -60,6 +60,13 @@ This version of CentOS is too old and unsupported" exit fi +# Detect environments where $PATH does not include the sbin directories +if ! grep -q sbin <<< $PATH; then + echo '$PATH does not include sbin +Try using "su -" instead of "su"' + exit +fi + systemd-detect-virt -cq is_container="$?"