summaryrefslogtreecommitdiff
path: root/debian/apm/ifplugd
blob: e2ecb17036a8c49fe04eca86fb1d4ea52ea96c3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# suspend ifplugd

[ -f /etc/default/ifplugd ] || exit 0
. /etc/default/ifplugd
[ -z "${SUSPEND_ACTION}" -o x"${SUSPEND_ACTION}" = x"none" ] && exit 0

if [ ${SUSPEND_ACTION} = "suspend" ] ; then
  RESUME_ACTION="resume"
elif [ ${SUSPEND_ACTION} = "stop" ] ; then
  RESUME_ACTION="start"
else
  exit 0
fi

if [ "$1" = suspend ]; then
    /etc/init.d/ifplugd ${SUSPEND_ACTION}
elif [ "$1" = resume ] && [ "$2" != standby ]; then
    /etc/init.d/ifplugd ${RESUME_ACTION}
fi

exit 0