diff options
author | Ermal <eri@pfsense.org> | 2010-05-07 11:02:45 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-07 11:02:45 +0000 |
commit | 8d964cea2ce977423f14cb24b4115a680c985ac7 (patch) | |
tree | 4260aa9ac2c54d9fd4c29a9260cb5ed03b0c892c | |
parent | da9d6701c330736e63bd4f4a4045ce486af26753 (diff) | |
download | pfsense-8d964cea2ce977423f14cb24b4115a680c985ac7.zip pfsense-8d964cea2ce977423f14cb24b4115a680c985ac7.tar.gz |
Add scpecific scripts for when ovpn goes up and down so we get neccessary values for used in varius areas of pfSense. TODO is find out how to get DNS info form openvpn.
-rw-r--r-- | etc/inc/openvpn.inc | 4 | ||||
-rwxr-xr-x | usr/local/sbin/ovpn-linkdown | 7 | ||||
-rwxr-xr-x | usr/local/sbin/ovpn-linkup | 11 |
3 files changed, 20 insertions, 2 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 4343d5d..72630e7 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -336,8 +336,8 @@ function openvpn_reconfigure($mode,& $settings) { $conf .= "persist-key\n"; $conf .= "proto {$proto}\n"; $conf .= "cipher {$cipher}\n"; - $conf .= "up /etc/rc.filter_configure\n"; - $conf .= "down /etc/rc.filter_configure\n"; + $conf .= "up /usr/local/sbin/ovpn-linkup\n"; + $conf .= "down /usr/local/sbin/ovpn-linkdown\n"; if (!empty($iface_ip)) { $conf .= "local {$iface_ip}\n"; diff --git a/usr/local/sbin/ovpn-linkdown b/usr/local/sbin/ovpn-linkdown new file mode 100755 index 0000000..451f606 --- /dev/null +++ b/usr/local/sbin/ovpn-linkdown @@ -0,0 +1,7 @@ +#!/bin/sh +/sbin/pfctl -b $3 +# delete the node just in case mpd cannot do that +/bin/rm -f /var/etc/nameserver_$1 +/bin/rm -f /tmp/$1_router +/bin/rm -f /tmp/$1up +/usr/bin/touch /tmp/filter_dirty diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup new file mode 100755 index 0000000..2ade032 --- /dev/null +++ b/usr/local/sbin/ovpn-linkup @@ -0,0 +1,11 @@ +#!/bin/sh + +# write nameservers to file needs dns fidnings?! + +# let the configuration system know that the ip has changed. +#/bin/echo $1 > /tmp/rc.newwanip +/bin/echo $4 > /tmp/$1_router +/usr/bin/touch /tmp/$1up +# reload filter +/usr/bin/touch /tmp/filter_dirty +exit 0 |