S
S
Smi_ed2019-12-17 00:48:25
linux
Smi_ed, 2019-12-17 00:48:25

How to make a constant attempt to connect tun0?

Command for authorization

openvpn --config /etc/openvpn/server.ovpn --auth-user-pass /etc/openvpn/auth.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Smi_ed, 2019-12-17
@Smi_ed

cron -> * * * * * sudo -u root bash /root/connect.sh >/dev/null 2>&1
connect.sh file

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

FILE /etc/openvpn/vpnconnect.sh
#!/bin/bash
openvpn --config /etc/openvpn/server.ovpn --auth-user-pass /etc/openvpn/auth.txt
exit 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question