Kaydet (Commit) b8bf1453 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

plugCheck -> plugService. plugCheck will check link state

üst fa048ec4
......@@ -126,7 +126,7 @@ def callScript(name, state):
def plugCheck(device, state, wireless=False):
def plugService(device, state, wireless=False):
# Do nothing if ifplugd is missing
if not os.path.exists("/usr/sbin/ifplugd"):
......@@ -150,3 +150,9 @@ def plugCheck(device, state, wireless=False):
# Stop service
stopService(pidfile="/var/run/ifplugd.%s.pid" % device, donotify=False)
def plugCheck(device):
# Return true if ifplugd is missing
if not os.path.exists("/usr/sbin/ifplugstatus"):
return True
return subprocess.call(["/usr/sbin/ifplugstatus", "-q", device]) == 2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment