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>
# 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