From 8b0b1a086b343030ca61b9527edd35d0f51f7009 Mon Sep 17 00:00:00 2001 From: Nyr Date: Tue, 19 May 2020 17:03:03 +0200 Subject: [PATCH] Check for sbin in $PATH --- wireguard-install.sh | 7 +++++++ 1 file changed, 7 insertions(+) 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="$?"