Last active
April 12, 2017 06:18
-
-
Save Weeker/a3777c4104f646c96c50 to your computer and use it in GitHub Desktop.
SSLedge for Raspberry Pi
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/sh | |
### BEGIN INIT INFO | |
# Provides: SSLedge | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: SSLedge for Raspberry Pi | |
# Web: https://eurekavpt.com/ | |
### END INIT INFO | |
HOMEDIR=/home/pi | |
DAEMON=/usr/bin/ssledge-term-1.5b24-p1-arm-s | |
config=$HOMEDIR/ssledge-tls.conf | |
start() { | |
if [ -f $config ]; then | |
echo "Starting SSLedge ..." | |
start-stop-daemon -b -o -S -x $DAEMON -- -f $config | |
else | |
echo "Couldn't start SSLedge (no $config found)" | |
fi | |
} | |
stop() { | |
sslpid=`pgrep -f $DAEMON` | |
if [ ! -z "$sslpid" ]; then | |
echo "Stopping SSLedge !" | |
start-stop-daemon -o -K -x $DAEMON | |
fi | |
} | |
status() { | |
sslpid=`pgrep -f $DAEMON` | |
if [ -z "$sslpid" ]; then | |
echo "SSLedge : not running." | |
else | |
echo "SSLedge : running (pid $sslpid)" | |
fi | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart|reload|force-reload) | |
stop | |
start | |
;; | |
status) | |
status | |
;; | |
*) | |
echo "Usage: /etc/init.d/ssledge {start|stop|reload|force-reload|restart|status}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment