summaryrefslogtreecommitdiff
path: root/files/CentOS
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-03-31 02:13:08 +0200
committermh <mh@immerda.ch>2010-03-31 02:13:08 +0200
commit130c571a0c251582b0632c57790f7bb3fc6048b1 (patch)
tree4df70bffb84ee93c55657dd2604e6c39a59b9dbc /files/CentOS
parentb9319395f5a2f72c5e08ef00aa4442b02b075106 (diff)
introduce centos support
Diffstat (limited to 'files/CentOS')
-rw-r--r--files/CentOS/stunnel.init137
1 files changed, 137 insertions, 0 deletions
diff --git a/files/CentOS/stunnel.init b/files/CentOS/stunnel.init
new file mode 100644
index 0000000..9b4b798
--- /dev/null
+++ b/files/CentOS/stunnel.init
@@ -0,0 +1,137 @@
+#!/bin/bash
+#
+# Script to run stunnel in daemon mode at boot time.
+#
+# Check http://www.gaztronics.net/ for the
+# most up-to-date version of this script.
+#
+# This script is realeased under the terms of the GPL.
+# You can source a copy at:
+# http://www.fsf.org/copyleft/copyleft.html
+#
+# Please feel free to modify the script to suite your own needs.
+# I always welcome email feedback with suggestions for improvements.
+# Please do not email for general support. I do not have time to answer
+# personal help requests.
+
+# Author: Gary Myers MIIE MBCS
+# email: http://www.gaztronics.net/webform/
+# Revision 1.0 - 4th March 2005
+
+#====================================================================
+# Run level information:
+#
+# chkconfig: 2345 99 99
+# description: Secure Tunnel
+# processname: stunnel
+#
+# Run "/sbin/chkconfig --add stunnel" to add the Run levels.
+# This will setup the symlinks and set the process to run at boot.
+#====================================================================
+
+#====================================================================
+# Paths and variables and system checks.
+
+# Source function library (It's a Red Hat thing!)
+. /etc/rc.d/init.d/functions
+
+# Check that networking is up.
+#
+[ ${NETWORKING} ="yes" ] || exit 0
+
+# Path to the executable.
+#
+SEXE=/usr/sbin/stunnel
+
+# Path to the configuration file.
+#
+CONF=/etc/stunnel/stunnel.conf
+
+# Check the configuration file exists.
+#
+if [ ! -f $CONF ] ; then
+ echo "The configuration file cannot be found!"
+exit 0
+fi
+
+# Path to the lock file.
+#
+LOCK_FILE=/var/lock/subsys/stunnel
+
+#====================================================================
+
+#====================================================================
+# Run controls:
+
+prog=$"stunnel"
+
+RETVAL=0
+
+# Start stunnel as daemon.
+#
+start() {
+ if [ -f $LOCK_FILE ]; then
+ echo "stunnel is already running!"
+ exit 0
+ else
+ echo -n $"Starting $prog: "
+ $SEXE $CONF
+ fi
+
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && success
+ echo
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
+ return $RETVAL
+}
+
+
+# Stop stunnel.
+#
+stop() {
+ if [ ! -f $LOCK_FILE ]; then
+ echo "stunnel is not running!"
+ exit 0
+
+ else
+
+ echo -n $"Shutting down $prog: "
+ killproc stunnel
+ RETVAL=$?
+ [ $RETVAL -eq 0 ]
+ rm -f $LOCK_FILE
+ echo
+ return $RETVAL
+
+ fi
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f $LOCK_FILE ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
+ status)
+ status stunnel
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ RETVAL=1
+esac
+
+exit $RETVAL