]> git.pld-linux.org Git - packages/stunnel.git/blame - stunnel.init
- simplified doc paths in files, removed stunnel.init from doc
[packages/stunnel.git] / stunnel.init
CommitLineData
44a8700b 1#!/bin/sh
2#
3# stunnel stunnel (Universal SSL tunnel)
4#
5# chkconfig: 345 14 91
6#
7# description: stunnel (Universal SSL tunnel)
8#
9# id: $Id$
10#
11
12# Source function library
13. /etc/rc.d/init.d/functions
14
15# Get network config
16. /etc/sysconfig/network
17
18# Get service config
19[ -f /etc/sysconfig/stunnel ] && . /etc/sysconfig/stunnel
20
21# Check that networking is up.
22if is_no "${NETWORKING}"; then
23 msg_network_down stunnel
24 exit 1
25fi
26
27# Daemon doesn't die if config doesn't exist
28if [ ! -f $STUNNEL_CONFIG ]; then
29 echo "Stunnel config $STUNNEL_CONFIG does not exist."
30 exit 1
31fi
32
33# See how we were called.
34case "$1" in
35 start)
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/stunnel ]; then
38 msg_starting stunnel; busy
39 daemon stunnel $STUNNEL_CONFIG
40 RETVAL=$?
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/stunnel
42 else
43 msg_already_running stunnel
44 exit 1
45 fi
46 ;;
47 stop)
48 if [ -f /var/lock/subsys/stunnel ]; then
49 msg_stopping stunnel
50 killproc stunnel
51 rm -f /var/run/stunnel/stunnel.pid /var/lock/subsys/stunnel >/dev/null 2>&1
52 else
53 msg_not_running stunnel
54 exit 1
55 fi
56 ;;
57 restart)
58 $0 stop
59 $0 start
60 ;;
61 status)
62 status stunnel
63 exit $?
64 ;;
65 *)
66 msg_usage "$0 {start|stop|status|restart}"
67 exit 1
68esac
69
70exit $RETVAL
This page took 0.074159 seconds and 4 git commands to generate.