Added semicolons required by bash2 (Mads Kiilerich).
This commit is contained in:
parent
bce2179fe3
commit
92387475ac
1 changed files with 10 additions and 10 deletions
20
redhat/tinc
20
redhat/tinc
|
@ -57,7 +57,7 @@ fi
|
|||
|
||||
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'`
|
||||
|
@ -65,18 +65,18 @@ vpn_load () {
|
|||
|
||||
# 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 "**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 "**tinc: multiple TapDevice entries not allowed!" >&2 ; return 3 }
|
||||
{ echo "**tinc: multiple TapDevice entries not allowed!" >&2; return 3; }
|
||||
[ -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 "**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 "**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`
|
||||
|
@ -118,7 +118,7 @@ vpn_load () {
|
|||
|
||||
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
|
||||
|
@ -128,7 +128,7 @@ vpn_start () {
|
|||
|
||||
# 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
|
||||
|
@ -139,7 +139,7 @@ vpn_start () {
|
|||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue