mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
20 lines
391 B
Text
20 lines
391 B
Text
|
#!/bin/bash
|
||
|
# script to turn on openvpn
|
||
|
|
||
|
# do nothing if it is not installed
|
||
|
which openvpn
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo Cannot find the openvpn program.
|
||
|
exit 1
|
||
|
fi
|
||
|
systemctl enable openvpn@xscenet.service
|
||
|
systemctl start openvpn@xscenet.service
|
||
|
|
||
|
sleep 5
|
||
|
ping -c 2 10.8.0.1
|
||
|
if [ $? -eq 0 ]; then
|
||
|
echo Openvpn successfully started.
|
||
|
else
|
||
|
echo Openvpn failed to contact remote server.
|
||
|
fi
|