diff --git a/vpnc-script b/vpnc-script index 6302987..0714bf1 100755 --- a/vpnc-script +++ b/vpnc-script @@ -121,7 +121,7 @@ if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then include /lib/network MODIFYRESOLVCONF=modify_resolvconf_openwrt RESTORERESOLVCONF=restore_resolvconf_openwrt -elif [ -x /usr/bin/busctl ]; then # For systemd-resolved (version 229 and above) +elif [ -n "$(busctl --version 2>/dev/null)" ] && [ "$(systemctl is-active systemd-resolved)" = "active" ] && [ "$(readlink /etc/resolv.conf)" = "/run/systemd/resolve/resolv.conf" ]; then # For systemd-resolved (version 229 and above) MODIFYRESOLVCONF=modify_resolved_manager RESTORERESOLVCONF=restore_resolved_manager elif [ -x /sbin/resolvconf ]; then # Optional tool on Debian, Ubuntu, Gentoo and FreeBSD