2011-06-29 15:46:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
start() {
|
2014-12-15 23:56:27 +01:00
|
|
|
echo -n "Starting stunnel: "
|
|
|
|
start-stop-daemon -S -q -p /var/run/stunnel.pid --exec /usr/bin/stunnel
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2011-06-29 15:46:17 +02:00
|
|
|
}
|
2014-12-15 23:56:27 +01:00
|
|
|
|
2011-06-29 15:46:17 +02:00
|
|
|
stop() {
|
2014-12-15 23:56:27 +01:00
|
|
|
echo -n "Stopping stunnel: "
|
|
|
|
start-stop-daemon -K -q -p /var/run/stunnel.pid
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2011-06-29 15:46:17 +02:00
|
|
|
}
|
2014-12-15 23:56:27 +01:00
|
|
|
|
2011-06-29 15:46:17 +02:00
|
|
|
restart() {
|
2014-12-15 23:56:27 +01:00
|
|
|
stop
|
|
|
|
start
|
2011-06-29 15:46:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2014-12-15 23:56:27 +01:00
|
|
|
start
|
|
|
|
;;
|
2011-06-29 15:46:17 +02:00
|
|
|
stop)
|
2014-12-15 23:56:27 +01:00
|
|
|
stop
|
|
|
|
;;
|
2011-06-29 15:46:17 +02:00
|
|
|
restart|reload)
|
2014-12-15 23:56:27 +01:00
|
|
|
restart
|
|
|
|
;;
|
2011-06-29 15:46:17 +02:00
|
|
|
*)
|
2014-12-15 23:56:27 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
exit 1
|
2011-06-29 15:46:17 +02:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|