Help understand cron script
I found this guide that another pfsense user setup to work with private internet access to determine what ports are open. He posted this guide in June 2013:
So I did manage to get this working. Turns out I was simply missing an @ symbol. Here are the 3 scripts. I will type up a tutorial later this week (busy, just got a few RE4 WD drives, tinkering with RAID).
Script Contents: (all in ETC folder)
/sbin/ifconfig ovpnc1 | /usr/bin/grep -w "inet" | /usr/bin/cut -f2 -d " " > /tmp/vpn_ip
/usr/local/bin/curl ifconfig.me/ip|tee /tmp/vpn_external
/usr/local/bin/curl -d "user=USERNAME&pass=PASSWORD&client_id=$@(/bin/cat ~/.pia_config)&local_ip=$(/bin/cat /tmp/vpn_ip)" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment -o /tmp/vpnportforward
NOTE: I renamed the pia client config to "pia_config" so you may need to change that. and of course, enter your username and password.
* * * * root /usr/bin/nice -n20 /etc/script3.sh
* * * * root /usr/bin/nice -n20 /etc/script1.sh
* * * * root /usr/bin/nice -n20 /etc/script2.sh
I installed the Cron package and set it up (please see attached image). My question is where does this script output the file and did I setup my cron settings correctly?
Could you post the guide you were working off of?
Sure second post 4th page
I have tried to type in the scripts manually into the command lines.
The first script works and output the /tmp/vpn_ip file
the second scripts errors and states "/usr/local/bin/curl: Command not found.
Ok sencond script works after I typed: pkg_add -r curl
The third script now errors and says "Illegal variable name."