#!/bin/sh
# If we're offline, we don't need to do this.
	if [ "x$D" = "x" ]; then
		killall -q -HUP dbus-daemon || true
	fi

OPTS=""

if [ -n "$D" ]; then
    OPTS="--root=$D"
fi

if type systemctl >/dev/null 2>/dev/null; then
	systemctl $OPTS disable wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service

	if [ -z "$D" -a "disable" = "enable" ]; then
		systemctl restart wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service
	fi
fi
