7 .
/etc
/conf.d
/$daemon_name
9 STATEDIR
="/var/run/openvpn"
13 stat_busy
"Starting OpenVPN ... "
15 mkdir
-p "${STATEDIR}"
16 for cfg
in ${openvpn_confs}; do
17 stat_append
"$(basename "${cfg}" .conf) "
18 /usr
/sbin
/openvpn
--daemon --writepid "${STATEDIR}"/"$(basename "${cfg}" .conf)".pid --cd "$(dirname "${cfg}")" --config "${cfg}" || success
=$?
20 if [ $success -eq 0 ]; then
28 stat_busy
"Stopping OpenVPN ..."
29 for pidfile
in "${STATEDIR}"/*.pid
; do
30 stat_append
"$(basename "${pidfile}" .pid) "
31 kill $
(cat "${pidfile}" 2>/dev
/null
) 2>/dev
/null
43 echo "usage: $0 {start|stop|restart}"