Project

General

Profile

« Previous | Next » 

Revision 8d964cea

Added by Ermal LUÇI about 15 years ago

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.

View differences:

etc/inc/openvpn.inc
336 336
	$conf .= "persist-key\n";
337 337
	$conf .= "proto {$proto}\n";
338 338
	$conf .= "cipher {$cipher}\n";
339
	$conf .= "up /etc/rc.filter_configure\n";
340
	$conf .= "down /etc/rc.filter_configure\n";
339
	$conf .= "up /usr/local/sbin/ovpn-linkup\n";
340
	$conf .= "down /usr/local/sbin/ovpn-linkdown\n";
341 341

  
342 342
	if (!empty($iface_ip)) {
343 343
		$conf .= "local {$iface_ip}\n";	
usr/local/sbin/ovpn-linkdown
1
#!/bin/sh
2
/sbin/pfctl -b $3
3
# delete the node just in case mpd cannot do that
4
/bin/rm -f /var/etc/nameserver_$1
5
/bin/rm -f /tmp/$1_router
6
/bin/rm -f /tmp/$1up
7
/usr/bin/touch /tmp/filter_dirty
usr/local/sbin/ovpn-linkup
1
#!/bin/sh
2

  
3
# write nameservers to file needs dns fidnings?!
4

  
5
# let the configuration system know that the ip has changed.
6
#/bin/echo $1 > /tmp/rc.newwanip
7
/bin/echo $4 > /tmp/$1_router
8
/usr/bin/touch /tmp/$1up
9
# reload filter 
10
/usr/bin/touch /tmp/filter_dirty
11
exit 0

Also available in: Unified diff