openvpn --config /etc/openvpn/server.ovpn --auth-user-pass /etc/openvpn/auth.txt
ifconfig tun0 | grep error
if let "$?!=1"
then
echo "tun0 up" >> /root/openvpn.log
else
echo "tun0 down" >> /root/openvpn.log
bash /etc/openvpn/vpnconnect.sh
fi
exit 0
#!/bin/bash
openvpn --config /etc/openvpn/server.ovpn --auth-user-pass /etc/openvpn/auth.txt
exit 0