This is a script to start up & shut down multiple openvpn daemons by launching one daemon per directory in /etc/openvpn . It assumes that the user has made or symlinked the proper configuration file to /etc/openvpn/$VPN/local.conf. I did not add the legal or $Header stuff to the beggining of the script. Reproducible: Always Steps to Reproduce: 1. 2. 3. #!/sbin/runscript VPNDIR="/etc/openvpn" depend() { need net } start() { cd $VPNDIR for VPN in * do ebegin "Starting openvpn for $VPN" start-stop-daemon --start --pidfile \ /var/run/openvpn-$VPN.pid --startas /usr/sbin/openvpn \ -- --config $VPN/local.conf --writepid \ /var/run/openvpn-$VPN.pid \ --daemon --cd $VPN eend $? done } stop() { cd $VPNDIR for VPN in * do ebegin "Stoping openvpn for $VPN" start-stop-daemon --stop --pidfile /var/run/openvpn-$VPN.pid eend $? done }
committed