Skip to content

Instantly share code, notes, and snippets.

@StephenRadachy
Created August 8, 2017 01:16
Show Gist options
  • Save StephenRadachy/cea5ac78821062e3b6145007ebaf420c to your computer and use it in GitHub Desktop.
Save StephenRadachy/cea5ac78821062e3b6145007ebaf420c to your computer and use it in GitHub Desktop.
useful pfsense cron scripts
# Restart All OpenVPN connections
echo "<?php include('openvpn.inc'); openvpn_resync_all();?>" | /usr/local/bin/php -q >/dev/null 2>&1
# Speedtest (pip install speedtest-cli) to /var/log/speedtest.log
# format: <download as float>,<download unit (Mbit/s,Gbit/s)>,<upload as float>,<upload unit (Mbit/s,Gbit/s)>,<unix timestamp>
/usr/local/bin/speedtest | /usr/bin/grep "Download:\|Upload:" | /usr/bin/sed -E -e 's/Download: |Upload: //g' | /usr/bin/tr '[:space:]' ',' | /usr/bin/awk '{srand(); print $0 srand()}' >> ./speedtest.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment