From f480b95d218ad9d70885e94fc64ec1d2ffa07261 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Mon, 14 Dec 2020 13:37:31 -0800 Subject: [PATCH] Fix basename invocation on *BSD shells Modified version of !21. See discussion https://gitlab.com/openconnect/vpnc-scripts/-/merge_requests/21#note_465757246 Signed-off-by: Daniel Lenski --- vpnc-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpnc-script b/vpnc-script index 984eb5f..069a7a1 100755 --- a/vpnc-script +++ b/vpnc-script @@ -156,7 +156,7 @@ elif [ -x /usr/bin/busctl ] && [ ${RESOLVEDENABLED} = 1 ]; then # For systemd-resolved (version 229 and above) MODIFYRESOLVCONF=modify_resolved_manager_old RESTORERESOLVCONF=restore_resolved_manager_old -elif [ -x /sbin/resolvconf ] && [ `basename $(readlink /sbin/resolvconf)` != resolvectl ]; then +elif [ -x /sbin/resolvconf ] && [ "`basename $(readlink /sbin/resolvconf) 2> /dev/null`" != resolvectl ]; then # Optional tool on Debian, Ubuntu, Gentoo and FreeBSD # (ignored if symlink to resolvctl, created by some versions of systemd-resolved) MODIFYRESOLVCONF=modify_resolvconf_manager -- 2.50.1