25 lines
684 B
Plaintext
Executable File
25 lines
684 B
Plaintext
Executable File
#!/opt/bin/watchman
|
|
|
|
# openvpn init script for watchman
|
|
|
|
ROOTDIR='/share/MD0_DATA/.qpkg/Optware'
|
|
service_command="/usr/sbin/openvpn"
|
|
service_respawn=true
|
|
service_args=(${ROOTDIR}/etc/openvpn/dia/dia.ovpn)
|
|
#service_pidfile="${ROOTDIR}/var/run/openvpndia.pid"
|
|
service_logfile='/share/Public/logs/openvpn/openvpndia.log'
|
|
|
|
unset reload
|
|
|
|
start(){
|
|
while [ ! -e /lib/modules/others/tun.ko ]; do sleep 1; done
|
|
while [ ! -x /usr/sbin/openvpn ]; do sleep 1; done
|
|
while [ ! -e ${ROOTDIR}/etc/openvpn/dia/dia.ovpn ]; do sleep 1; done
|
|
while [ $(lsmod|grep tun|wc -l) != 1 ]; do insmod /lib/modules/others/tun.ko; sleep 1; done
|
|
watchman.start
|
|
}
|
|
|
|
status() {
|
|
kill -USR2 $(< $service_pidfile)
|
|
}
|