Magellan Linux

Diff of /trunk/openvpn/openvpn.rc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 943 by niro, Fri Sep 28 16:05:44 2007 UTC revision 944 by niro, Tue Dec 1 17:36:15 2009 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Header: /root/magellan-cvs/src/openvpn/openvpn.rc,v 1.1 2007-09-28 16:05:44 niro Exp $  # $Header: /root/magellan-cvs/src/openvpn/openvpn.rc,v 1.2 2009-12-01 17:36:15 niro Exp $
3    
4  #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k  #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k
5  #%start: 24  #%start: 24
# Line 10  Line 10 
10  #%before:  #%before:
11  #%after:  #%after:
12    
13  source /etc/sysconfig/rc  source /etc/conf.d/rc
14  source $rc_functions  source $rc_functions
15    
16  # Lockfile  # Lockfile
# Line 29  case "$1" in Line 29  case "$1" in
29   # load neccessary tun module   # load neccessary tun module
30   modprobe tun >/dev/null 2>&1   modprobe tun >/dev/null 2>&1
31    
32   # Run startup script, if defined   # run startup script, if defined
33   if [ -x ${configdir}/opnvpn-startup ]   if [ -x ${configdir}/opnvpn-startup ]
34   then   then
35   echo "    Running startup script ... "   echo "    Running startup script ... "
# Line 40  case "$1" in Line 40  case "$1" in
40    
41   rm -f ${piddir}/*.pid   rm -f ${piddir}/*.pid
42    
43   # Start every .conf in /etc/openvpn and run .sh if exists   # start every .conf in /etc/openvpn and run .sh if exists
44   for config in ${configdir}/*.conf   for config in ${configdir}/*.conf
45   do   do
46   echo "    Starting server for ${config} ... "   echo "    Starting server for ${config} ... "
# Line 66  case "$1" in Line 66  case "$1" in
66   update_svcstatus $1   update_svcstatus $1
67   splash svc_started "$(basename $0)" 0   splash svc_started "$(basename $0)" 0
68   ;;   ;;
69    
70   stop)   stop)
71   echo -e ${COLOREDSTAR}"Stopping OpenVPN:"   echo -e ${COLOREDSTAR}"Stopping OpenVPN:"
72    
# Line 79  case "$1" in Line 79  case "$1" in
79   evaluate_retval   evaluate_retval
80   done   done
81    
82   # Run shutdown script, if defined   # run shutdown script, if defined
83   if [[ -x ${configdir}/openvpn-shutdown ]]   if [[ -x ${configdir}/openvpn-shutdown ]]
84   then   then
85   echo "    Running shutdown script ... "   echo "    Running shutdown script ... "
# Line 90  case "$1" in Line 90  case "$1" in
90   update_svcstatus $1   update_svcstatus $1
91   splash svc_stopped "$(basename $0)" 0   splash svc_stopped "$(basename $0)" 0
92   ;;   ;;
93    
94   restart)   restart)
95   $0 stop   $0 stop
96   sleep 2   sleep 2
97   $0 start   $0 start
98   ;;   ;;
99    
100   reload)   reload)
101   for pidfile in ${piddir}/*.pid   for pidfile in ${piddir}/*.pid
102   do   do
# Line 107  case "$1" in Line 107  case "$1" in
107   evaluate_retval   evaluate_retval
108   done   done
109   ;;   ;;
110    
111   reopen)   reopen)
112   for pidfile in ${piddir}/*.pid   for pidfile in ${piddir}/*.pid
113   do   do
# Line 118  case "$1" in Line 118  case "$1" in
118   evaluate_retval   evaluate_retval
119   done   done
120   ;;   ;;
121    
122   status)   status)
123   statusproc /usr/sbin/openvpn   statusproc /usr/sbin/openvpn
124   ;;   ;;
125    
126   *)   *)
127   echo "Usage: openvpn {start|stop|restart|reload|reopen|status}"   echo "Usage: openvpn {start|stop|restart|reload|reopen|status}"
128   exit 1   exit 1

Legend:
Removed from v.943  
changed lines
  Added in v.944