Created
April 3, 2013 06:52
-
-
Save wolfg1969/5298986 to your computer and use it in GitHub Desktop.
sakis3g.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
ARGS="APN=\"CUSTOM_APN\" CUSTOM_APN=\"giffgaff.com\" FORCE_APN=\"giffgaff.com\" APN_USER=\"giffgaff\" APN_PASS=\"password\"" | |
PID=$(get_pid sakis) | |
case "$1" in | |
start) | |
stat_busy "Starting sakis" | |
[ -z "$PID" ] && /usr/sbin/sakis3g connect $ARGS &>/dev/null | |
if [ $? = 0 ]; then | |
add_daemon sakis | |
stat_done | |
else | |
stat_fail | |
exit 1 | |
fi | |
;; | |
stop) | |
stat_busy "Stopping sakis" | |
/usr/sbin/sakis3g disconnect &>/dev/null | |
if [ $? = 0 ]; then | |
rm_daemon sakis | |
stat_done | |
else | |
stat_fail | |
exit 1 | |
fi | |
;; | |
restart) | |
$0 stop | |
sleep 1 | |
$0 start | |
;; | |
*) | |
echo "usage: $0 {start|stop|restart}" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment