I ended up making this script on a DD-WRT router that is creating two unwanted files and I can't seem to understand why. I'm not a scripting genius, especially with bash, so any help would be appreciated.
#!/bin/sh sleep 30 mkdir /tmp/myvpn; cd /tmp/myvpn # ... doing stuff... while [ 1 ] do r1=`wget -q http://ipinfo.io/ip` > /dev/null r2=`$(wget -q "http://ipinfo.io/$r1/country")` > /dev/null if [ $r2 -eq "XX" ] then echo "XX OK" > /tmp/myvpn/result_check_vpn.txt else echo "XX NOK" > /tmp/myvpn/result_check_vpn.txt killall -q openvpn sleep 5 openvpn --config /tmp/openvpncl/openvpn.conf --route-up /tmp/myvpn/route-up.sh --down-pre /tmp/myvpn/route-down.sh --daemon sleep 25 sh /proc/net/ip_conntrack_flush fi sleep 180 done
This script creates two unwanted files in /tmp/myvpn called "country" and "ip". I must be doing something wrong. Basically the script tries to check if the VPN is established right by checking if I effectively changed country (it is necessary for me to perform this check).