Launch updateFreeVPN start.sh and add it to daily crontab

This commit is contained in:
Gabriele Pongelli
2020-03-30 14:43:20 +02:00
parent f7576b9575
commit 76192c4a2a

View File

@@ -56,7 +56,16 @@ then
elif [[ "${OPENVPN_PROVIDER^^}" = "FREEVPN" ]]
then
FREEVPN_DOMAIN=${OPENVPN_CONFIG%%-*}
export OPENVPN_PASSWORD=$(curl -s https://freevpn.${FREEVPN_DOMAIN:-"be"}/accounts/ | grep Password | sed s/"^.*Password\:.... "/""/g | sed s/"<.*"/""/g)
export OPENVPN_PASSWORD=$(curl -s https://freevpn.${FREEVPN_DOMAIN:-"me"}/accounts/ | grep Password | sed s/"^.*Password\:.... "/""/g | sed s/"<.*"/""/g)
# Update FreeVPN certs
/etc/openvpn/updateFreeVPN.sh
# Add daily update to cron
crontab -l > tempcron
echo "0 1 * * * /etc/openvpn/updateFreeVPN.sh" > tempcron
crontab tempcron
rm tempcron
elif [[ "${OPENVPN_PROVIDER^^}" = "VPNBOOK" ]]
then
pwd_url=$(curl -s "https://www.vpnbook.com/freevpn" | grep -m2 "Password:" | tail -n1 | cut -d \" -f2)