forked from awein/SleepProxyClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_sleepproxyclient
49 lines (39 loc) · 1.28 KB
/
00_sleepproxyclient
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# This file is part of SleepProxyClient.
#
# @license http://www.gnu.org/licenses/gpl.html GPL Version 3
# @author Andreas Weinlein <andreas.dev@weinlein.info>
# @copyright Copyright (c) 2012 Andreas Weinlein
#
# SleepProxyClient is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# SleepProxyClient is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SleepProxyClient. If not, see <http://www.gnu.org/licenses/>.
TAG="sleepproxyclient"
SCRIPTDIR="/usr/share/sleepproxyclient/scripts"
case $1 in
suspend|hibernate)
## RUN BEFORE SUSPEND OR HIBERNATE
service avahi-daemon restart
logger -t $TAG "running SPC"
bash $SCRIPTDIR/sleepproxyclient.sh
logger -t $TAG "done: $?"
;;
thaw|resume)
## RUN AFTER RESUME AND
## AFTER RESUME FROM SUSPEND TO DISK
if [ "$SPC_DEBUG" != "" ] ; then
logger -t $TAG "awake!"
fi
service avahi-daemon restart
;;
esac