forked from awein/SleepProxyClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sleepproxyclient.sh
54 lines (47 loc) · 1.45 KB
/
sleepproxyclient.sh
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
48
49
50
51
52
53
54
#!/usr/bin/env 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/>.
# get defaults
if [ -f /etc/default/sleepproxyclient ]
then
. /etc/default/sleepproxyclient
elif [ -f /etc/defaults/sleepproxyclient ]
then
. /etc/defaults/sleepproxyclient
fi
IF_OPT=""
if [ "$SPC_INTERFACES" != "" ]
then
IF_OPT="--interfaces $SPC_INTERFACES"
fi
TTL_OPT=""
if [ "$SPC_TTL" != "" ]
then
TTL_OPT="--ttl $SPC_TTL"
fi
DEBUG_OPT=""
if [ "$SPC_DEBUG" != "" ] ; then
DEBUG_OPT="--debug"
fi
SCRIPTDIR=`dirname $0`
if [ "$SPC_DEBUG" != "" ] ; then
echo "calling: python $SCRIPTDIR/sleepproxyclient.py $IF_OPT $TTL_OPT $DEBUG_OPT"
fi
python $SCRIPTDIR/sleepproxyclient.py $IF_OPT $TTL_OPT $DEBUG_OPT