blob: dbcdac5e45830e9e1f6e725d4b8243e75944ddf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
$NetBSD: patch-ac,v 1.6 2008/05/29 20:50:31 sketch Exp $
--- vpnc-script.orig 2007-09-06 21:05:15.000000000 +0100
+++ vpnc-script 2008-05-29 13:32:02.000000000 +0100
@@ -56,18 +56,19 @@
;;
esac
-DEFAULT_ROUTE_FILE=/var/run/vpnc/defaultroute
-RESOLV_CONF_BACKUP=/var/run/vpnc/resolv.conf-backup
-FULL_SCRIPTNAME=/usr/local/sbin/vpnc
+STATEDIR=@VARBASE@/run/vpnc
+DEFAULT_ROUTE_FILE=$STATEDIR/defaultroute
+RESOLV_CONF_BACKUP=$STATEDIR/resolv.conf-backup
+FULL_SCRIPTNAME=@PREFIX@/sbin/vpnc
SCRIPTNAME=`basename $FULL_SCRIPTNAME`
# some systems, eg. Darwin & FreeBSD, prune /var/run on boot
-if ! [ -d "/var/run/vpnc" ]; then
- mkdir -p /var/run/vpnc
+if ! [ -d $STATEDIR ]; then
+ mkdir -p $STATEDIR
fi
# stupid SunOS: no blubber in /usr/local/bin ... (on stdout)
-IPROUTE="`which ip | grep '^/' 2> /dev/null`"
+IPROUTE="`command -v ip | grep '^/' 2> /dev/null`"
if [ "$OS" = "Linux" ]; then
ifconfig_syntax_ptp="pointopoint"
@@ -157,7 +158,7 @@
# isn't -n supposed to give --numeric output?
# apperently not...
# Get rid of lines containing IPv6 addresses (':')
- netstat -r -n | sed 's/default/0.0.0.0/' | sed 's/^.*:.*$//' | grep '^0.0.0.0' | awk '{print $2}'
+ netstat -r -n | awk '/:/ { next; } $2 ~ /^link/ { next; } /^(default|0\.0\.0\.0)/ { print $2; }'
}
set_vpngateway_route() {
|