30 lines
885 B
Plaintext
30 lines
885 B
Plaintext
![]() |
description "openvpn daemons startup"
|
||
|
author "Michael Freitag <Michael.Freitag@freitag-it.de>"
|
||
|
version 1.0
|
||
|
emits none special
|
||
|
|
||
|
start on (runlevel [2345] and (started rpc))
|
||
|
stop on runlevel [016]
|
||
|
|
||
|
console none
|
||
|
|
||
|
pre-start script
|
||
|
modprobe tun
|
||
|
if [ ! -d /dev/net ]; then
|
||
|
mkdir /dev/net
|
||
|
fi
|
||
|
rm -f /dev/net/tun && mknod /dev/net/tun c 10 200
|
||
|
|
||
|
if [ ! -f /etc/sysconfig/net/openvpn/default.key ]; then
|
||
|
openvpn --genkey --secret /etc/sysconfig/net/openvpn/default.key
|
||
|
fi
|
||
|
end script
|
||
|
|
||
|
script
|
||
|
cd /etc/sysconfig/net/openvpn
|
||
|
for CONFIG in `ls *.config`; do
|
||
|
echo -n "..."$CONFIG | sed -e "s/.config//g"
|
||
|
openvpn --config /etc/sysconfig/net/openvpn/$CONFIG &
|
||
|
done
|
||
|
end script
|