7 STATEDIR
="/var/run/openvpn"
11 stat_busy
"Starting OpenVPN ... "
13 mkdir
-p "${STATEDIR}"
14 for cfg
in "${CFGDIR}"/*.conf
; do
15 stat_append
"$(basename "${cfg}" .conf) "
16 /usr
/sbin
/openvpn
--daemon --writepid "${STATEDIR}"/"$(basename "${cfg}" .conf)".pid --cd "${CFGDIR}" --config "${cfg}" || success
=$?
18 if [ $success -eq 0 ]; then
26 stat_busy
"Stopping OpenVPN ..."
27 for pidfile
in "${STATEDIR}"/*.pid
; do
28 stat_append
"$(basename "${pidfile}" .pid) "
29 kill $
(cat "${pidfile}" 2>/dev
/null
) 2>/dev
/null
41 echo "usage: $0 {start|stop|restart}"