rc.main 788 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #! /bin/sh -
  2. #
  3. # wpa_supplicant/rc.main
  4. #
  5. # Wi-Fi Protected Access client and IEEE 802.1X supplicant.
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-wpa_supplicant}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting wpa_supplicant ..."
  14. # Check if the dbus daemon is running
  15. if ! perpok -u3 dbus
  16. then
  17. echo "${SVNAME}: Dependency 'dbus' not running." 1>&2
  18. exit 1
  19. fi
  20. exec /usr/sbin/wpa_supplicant -u -c /etc/wpa_supplicant.conf
  21. }
  22. reset()
  23. {
  24. case $3 in
  25. exit)
  26. echo "*** ${SVNAME}: Exited status $4"
  27. ;;
  28. signal)
  29. echo "*** ${SVNAME}: Killed on signal $5"
  30. ;;
  31. *)
  32. echo "*** ${SVNAME}: Stopped (${3})"
  33. ;;
  34. esac
  35. }
  36. # Branch to target
  37. eval ${TARGET} "$@"