Skip to content

Instantly share code, notes, and snippets.

@wolfg1969
Created April 3, 2013 06:52
Show Gist options
  • Save wolfg1969/5298986 to your computer and use it in GitHub Desktop.
Save wolfg1969/5298986 to your computer and use it in GitHub Desktop.
sakis3g.sh
#!/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