/apm/resume.d/80ifplugd

http://github.com/brinkman83/bashrc · Shell · 22 lines · 16 code · 4 blank · 2 comment · 8 complexity · 7d5c0b8bf9d49cb9d3735e10640f5d38 MD5 · raw file

  1. #!/bin/sh
  2. # suspend ifplugd
  3. [ -f /etc/default/ifplugd ] || exit 0
  4. . /etc/default/ifplugd
  5. [ "$SUSPEND_ACTION" ] || [ "$SUSPEND_ACTION" != "none" ] || exit 0
  6. if [ "$SUSPEND_ACTION" = "suspend" ] ; then
  7. RESUME_ACTION="resume"
  8. elif [ "$SUSPEND_ACTION" = "stop" ] ; then
  9. RESUME_ACTION="start"
  10. else
  11. exit 0
  12. fi
  13. if [ "$1" = suspend ]; then
  14. /etc/init.d/ifplugd ${SUSPEND_ACTION}
  15. elif [ "$1" = resume ] && [ "$2" != standby ]; then
  16. /etc/init.d/ifplugd ${RESUME_ACTION}
  17. fi
  18. exit 0