Skip to content

Instantly share code, notes, and snippets.

@notthetup
Created September 17, 2016 06:50
Show Gist options
  • Save notthetup/029235ee6ebab0942319ddee0c574da4 to your computer and use it in GitHub Desktop.
Save notthetup/029235ee6ebab0942319ddee0c574da4 to your computer and use it in GitHub Desktop.
#! /bin/sh
# /etc/init.d/autoconnectnet
### BEGIN INIT INFO
# Provides: noip
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
# Description: A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
### END INIT INFO
case "$1" in
start)
sleep 10
echo "connecting via sakis3g"
# run application you want to start
/opt/sakis3g/sakis3g --sudo "connect"
;;
stop)
echo "dissconnecting via sakis3g"
# kill application you want to stop
/opt/sakis3g/sakis3g --sudo "disconnect"
;;
*)
echo "Usage: /etc/init.d/autoconnectnet {start|stop}"
exit 1
;;
esac
exit 0
#*********************************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment