aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/check-ovpn.sh
blob: fe5d576a7b223a5cc461878716ebb4b524e4790b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

# Check that the vpn is up. Check every 5 seconds for 11 times - for
# use as a minutely cron task
for i in $(seq 1 11); do
  if ifconfig tun0 | grep -q "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00"; then
    echo YES > ~/.local/ovpn-up
  else
    rm -f ~/.local/ovpn-up
  fi
  sleep 5
done