projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added new config variable "ProxyMode". If enabled, all outgoing packets
[tinc]
/
redhat
/
tinc
diff --git
a/redhat/tinc
b/redhat/tinc
index
e2a7543
..
704d5a2
100644
(file)
--- a/
redhat/tinc
+++ b/
redhat/tinc
@@
-57,7
+57,7
@@
fi
vpn_load () {
CFG="$TCONF/$1/tinc.conf"
vpn_load () {
CFG="$TCONF/$1/tinc.conf"
- [ -f $CFG ] || { echo "**tinc: $CFG does not exist!" >&2
; return 1
}
+ [ -f $CFG ] || { echo "**tinc: $CFG does not exist!" >&2
; return 1;
}
# load TINCD config
DEV=`grep -i -e '^[[:space:]]*TapDevice' $CFG | sed 's/[[:space:]]//g; s/^.*=//g'`
# load TINCD config
DEV=`grep -i -e '^[[:space:]]*TapDevice' $CFG | sed 's/[[:space:]]//g; s/^.*=//g'`
@@
-65,18
+65,18
@@
vpn_load () {
# discourage empty and multiple entries
[ -z "$DEV" ] && \
# discourage empty and multiple entries
[ -z "$DEV" ] && \
- { echo "**tinc: TapDevice required!" >&2
; return 2
}
+ { echo "**tinc: TapDevice required!" >&2
; return 2;
}
echo $DEV | grep -q '^/dev/tap' ||
echo $DEV | grep -q '^/dev/tap' ||
- { echo "**tinc: TapDevice should be in form /dev/tapX" >&2
; return 2
}
+ { echo "**tinc: TapDevice should be in form /dev/tapX" >&2
; return 2;
}
[ `echo $DEV | wc -l` -gt 1 ] && \
[ `echo $DEV | wc -l` -gt 1 ] && \
- { echo "**tinc: multiple TapDevice entries not allowed!" >&2
; return 3
}
+ { echo "**tinc: multiple TapDevice entries not allowed!" >&2
; return 3;
}
[ -z "$VPN" ] && \
[ -z "$VPN" ] && \
- { echo "**tinc: MyOwnVPNIP/MyVirtualIP required!" >&2
; return 2
}
+ { echo "**tinc: MyOwnVPNIP/MyVirtualIP required!" >&2
; return 2;
}
[ `echo $VPN | wc -l` -gt 1 ] && \
[ `echo $VPN | wc -l` -gt 1 ] && \
- { echo "**tinc: multiple MyOwnVPNIP/MyVirtualIP entries not allowed!" >&2
; return 3
}
+ { echo "**tinc: multiple MyOwnVPNIP/MyVirtualIP entries not allowed!" >&2
; return 3;
}
echo $VPN | grep -q -x \
'\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\}/[[:digit:]]\{1,2\}' || \
echo $VPN | grep -q -x \
'\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\}/[[:digit:]]\{1,2\}' || \
- { echo "**tinc: badly formed MyOwnVPNIP/MyVirtualIP address $VPN!"
; return 3
}
+ { echo "**tinc: badly formed MyOwnVPNIP/MyVirtualIP address $VPN!"
; return 3;
}
# network device
TAP=`echo $DEV | cut -d"/" -f3`
# network device
TAP=`echo $DEV | cut -d"/" -f3`
@@
-118,7
+118,7
@@
vpn_load () {
vpn_start () {
vpn_start () {
- vpn_load $1 || { echo "**tinc: could not vpn_load $1" >&2
; return 1
}
+ vpn_load $1 || { echo "**tinc: could not vpn_load $1" >&2
; return 1;
}
# create device file
if [ ! -c $DEV ]; then
# create device file
if [ ! -c $DEV ]; then
@@
-128,7
+128,7
@@
vpn_start () {
# load device module
{ insmod ethertap --name="ethertap$NUM" unit="$NUM" 2>&1 || \
# load device module
{ insmod ethertap --name="ethertap$NUM" unit="$NUM" 2>&1 || \
- { echo "**tinc: cannot insmod ethertap$NUM" >&2
; return 2
}
+ { echo "**tinc: cannot insmod ethertap$NUM" >&2
; return 2;
}
} | grep -v '^Us'
# configure the interface
} | grep -v '^Us'
# configure the interface
@@
-139,7
+139,7
@@
vpn_start () {
# start tincd
$TINCD --net="$1" $DEBUG || \
# start tincd
$TINCD --net="$1" $DEBUG || \
- { echo "**tinc: could not start $TINCD" >&2; return 3 }
+ { echo "**tinc: could not start $TINCD" >&2; return 3
;
}
# default interface route
# ip route add $NET/$LEN dev $TAP
# default interface route
# ip route add $NET/$LEN dev $TAP