3 # Init Script to run stunnel in daemon mode at boot time.
5 # Author: Riccardo Riva - RPM S.r.l.
6 # Revision 1.0 - 2010 November, 11
8 #====================================================================
9 # Run level information:
11 # chkconfig: 2345 99 99
12 # description: Secure Tunnel
13 # processname: stunnel
15 # Run "/sbin/chkconfig --add stunnel" to add the Run levels.
16 # This will setup the symlinks and set the process to run at boot.
17 #====================================================================
19 #====================================================================
20 # Paths and variables and system checks.
22 # Source function library
23 . /etc/rc.d/init.d/functions
25 # Check that networking is up.
27 [ ${NETWORKING} ="yes" ] || exit 0
29 # Path to the executable.
33 # Path to the configuration file.
35 CONF=/etc/stunnel/stunnel.conf
37 # Check the configuration file exists.
39 if [ ! -f $CONF ] ; then
40 echo "The configuration file cannot be found!"
44 # Path to the lock file.
46 LOCK_FILE=/var/lock/subsys/stunnel
48 #====================================================================
56 # Start stunnel as daemon.
59 if [ -f $LOCK_FILE ]; then
60 echo "stunnel is already running!"
63 echo -n $"Starting $prog: "
68 [ $RETVAL -eq 0 ] && success
70 [ $RETVAL -eq 0 ] && touch $LOCK_FILE
77 if [ ! -f $LOCK_FILE ]; then
78 echo "stunnel is not running!"
83 echo -n $"Shutting down $prog: "
94 # See how we were called.
107 if [ -f $LOCK_FILE ]; then
118 echo $"Usage: $0 {start|stop|restart|condrestart|status}"