Project

General

Profile

Download (1.72 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2
#
3
# ovpn-linkup
4
#
5
# part of pfSense (https://www.pfsense.org)
6
# Copyright (c) 2004-2013 BSD Perimeter
7
# Copyright (c) 2013-2016 Electric Sheep Fencing
8
# Copyright (c) 2014-2019 Rubicon Communications, LLC (Netgate)
9
# All rights reserved.
10
#
11
# Licensed under the Apache License, Version 2.0 (the "License");
12
# you may not use this file except in compliance with the License.
13
# You may obtain a copy of the License at
14
#
15
# http://www.apache.org/licenses/LICENSE-2.0
16
#
17
# Unless required by applicable law or agreed to in writing, software
18
# distributed under the License is distributed on an "AS IS" BASIS,
19
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
# See the License for the specific language governing permissions and
21
# limitations under the License.
22

    
23
if [ "${dev_type}" = "tun" ]; then
24
	if [ -n "${route_vpn_gateway}" ]; then
25
		/bin/echo ${route_vpn_gateway} > /tmp/${1}_router
26
	elif [ -n "${ifconfig_remote}" ]; then
27
		/bin/echo ${ifconfig_remote} > /tmp/${1}_router
28
	elif [ -n "${ifconfig_local}" ]; then
29
		/bin/echo ${ifconfig_local} > /tmp/${1}_router
30
	else
31
		/bin/echo ${5} > /tmp/${1}_router
32
	fi
33

    
34
	if [ -n "${route_ipv6_gateway_1}" ]; then
35
		/bin/echo ${route_ipv6_gateway_1} > /tmp/${1}_routerv6
36
	elif [ -n "${ifconfig_ipv6_remote}" ]; then
37
		/bin/echo ${ifconfig_ipv6_remote} > /tmp/${1}_routerv6
38
	elif [ -n "${ifconfig_ipv6_local}" ]; then
39
		/bin/echo ${ifconfig_ipv6_local} > /tmp/${1}_routerv6
40
	fi
41

    
42
else
43
	if [ -n "${route_vpn_gateway}" ]; then
44
		/bin/echo ${route_vpn_gateway} > /tmp/${1}_router
45
	fi
46

    
47
	if [ -n "${route_ipv6_gateway_1}" ]; then
48
		/bin/echo ${route_ipv6_gateway_1} > /tmp/${1}_routerv6
49
	fi
50
fi
51

    
52
/usr/bin/touch /tmp/${1}up
53
# reload filter
54
/usr/local/sbin/pfSctl -c "interface newip ${1}"
55
exit 0
(11-11/31)