Skip to content

Instantly share code, notes, and snippets.

@likai24
Created October 11, 2016 03:46
Show Gist options
  • Save likai24/508da69413ecc7200929d5fa6fdad901 to your computer and use it in GitHub Desktop.
Save likai24/508da69413ecc7200929d5fa6fdad901 to your computer and use it in GitHub Desktop.
vpn_check.sh
#!/bin/bash
id=$(ps axw | grep "[ /]pppd call $1" | awk '{print $1}')
if [[ -z $id ]];
then
echo 'no connection' >> /var/log/pptp/retry
sudo pon yourdomainname
else
echo 'yes'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment