]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
Fix basename invocation on *BSD shells
authorDaniel Lenski <dlenski@gmail.com>
Mon, 14 Dec 2020 21:37:31 +0000 (13:37 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Tue, 15 Dec 2020 01:24:11 +0000 (17:24 -0800)
Modified version of !21. See discussion https://gitlab.com/openconnect/vpnc-scripts/-/merge_requests/21#note_465757246

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
vpnc-script

index 984eb5f6d93b437798f9a4ca5ba8a19978465f6e..069a7a152c28f2e4089c7f048956800689113d95 100755 (executable)
@@ -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