PageRenderTime 46ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 28ms app.codeStats 0ms

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