X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=redhat%2Ftinc;h=704d5a251c762da6b9d5f14b29a7404465e759fd;hp=e2a75439525d6d08d6cd6a25efd4b7a34b5df410;hb=92387475ace9b06af39987c71ac563cf29427009;hpb=2bc7a0c92831802eec167ad193515962a63690dd diff --git a/redhat/tinc b/redhat/tinc index e2a75439..704d5a25 100644 --- a/redhat/tinc +++ b/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