summarylogtreecommitdiffstats
path: root/ip-pre-up.sh
blob: 4f632e56c069b1b14a55417aa1c8dab4edb3c61a (plain)
1
2
3
4
5
6
7
8
#!/usr/bin/bash

OLD_GATEWAY=`ip route show | grep '^default' | sed -e 's/default via \([^ ]*\).*/\1/'`

if [[ -n $OLD_GATEWAY ]]; then
  echo $OLD_GATEWAY > /run/vpn-old-gateway
  chmod 644 /run/vpn-old-gateway
fi