service.py 653 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. from comar.service import *
  3. serviceType = "local"
  4. serviceDefault = "off" #NM starts wpa_supp automatically. Use at your own risk if you start manually
  5. serviceDesc = _({"en": "WPA Daemon",
  6. "tr": "WPA Hizmeti"})
  7. PIDFILE = "/run/wpa_supplicant.pid"
  8. @synchronized
  9. def start():
  10. startService(command="/usr/sbin/wpa_supplicant",
  11. args="-WuB -P%s %s" % (PIDFILE, config.get("OPTS", "")),
  12. pidfile=PIDFILE,
  13. donotify=True)
  14. @synchronized
  15. def stop():
  16. stopService(pidfile=PIDFILE,
  17. donotify=True)
  18. def status():
  19. return isServiceRunning(PIDFILE)