summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatrio2015-12-29 11:16:09 +0300
committerNatrio2015-12-29 11:16:09 +0300
commit2310c3a1cde563105e767f0068c170e945ae8444 (patch)
tree91a05e529085333e78d2b3a0e75cde9708df677e
parent3dc4bb60253fabc4eef31f2b8e7e210648386c2c (diff)
downloadaur-2310c3a1cde563105e767f0068c170e945ae8444.tar.gz
Update tun-cfg to v1.7.1, allow client-side connection abort.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD2
-rw-r--r--README.tun-cfg4
-rwxr-xr-xtun-cfg24
4 files changed, 20 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ac1768917831..4d2b6d91c49f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Wed Dec 16 08:12:25 UTC 2015
+# Tue Dec 29 08:14:47 UTC 2015
pkgbase = vtun
pkgdesc = The easiest way to create Virtual Tunnels over TCP/IP networks with traffic shaping, compression, encryption and IPv6 support.
pkgver = 3.0.3.2013.d
- pkgrel = 6
+ pkgrel = 7
url = http://vtun.sourceforge.net/
install = vtun.install
arch = i686
diff --git a/PKGBUILD b/PKGBUILD
index b27e31a2b340..c4e1c8d4f037 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=vtun
pkgver=3.0.3.2013.d
_pkgver=3.0.3
-pkgrel=6
+pkgrel=7
pkgdesc="The easiest way to create Virtual Tunnels over TCP/IP networks with traffic shaping, compression, encryption and IPv6 support."
arch=('i686' 'x86_64' 'armv7h' 'armv6h')
url="http://vtun.sourceforge.net/"
diff --git a/README.tun-cfg b/README.tun-cfg
index 9aca2c4db50f..b193ef7637b7 100644
--- a/README.tun-cfg
+++ b/README.tun-cfg
@@ -1,4 +1,4 @@
-Tunnel-configurer version 1.7
+Tunnel-configurer version 1.7.1
Client-server IP tunnel configuration via the same IP tunnel.
-- vtund.conf --
@@ -99,7 +99,7 @@ noroutes|-r : server - Don't send any routes from config
: client - Don't get IPv4 routes from server
no6routes|-R : Don't get IPv6 routes from server (client only)
timeout|-t <sec> : default=10, 0=endless
- abort|-k : Abort connection after timeout (server only)
+ abort|-k : Abort connection after timeout
keep|-K : ... or don't do it
nofork|-B | nobg | nobackground
diff --git a/tun-cfg b/tun-cfg
index d2433a41de8e..fedc80c10f9b 100755
--- a/tun-cfg
+++ b/tun-cfg
@@ -28,7 +28,7 @@ ABORT=
usage() {
[[ -n "$1" ]] && return 0
- echo "Tunnel-configurer version 1.7
+ echo "Tunnel-configurer version 1.7.1
Client-server IP tunnel configuration via the same IP tunnel.
-- vtund.conf --
@@ -129,7 +129,7 @@ noroutes|-r : server - Don't send any routes from config
: client - Don't get IPv4 routes from server
no6routes|-R : Don't get IPv6 routes from server (client only)
timeout|-t <sec> : default=10, 0=endless
- abort|-k : Abort connection after timeout (server only)
+ abort|-k : Abort connection after timeout
keep|-K : ... or don't do it
nofork|-B | nobg | nobackground
@@ -237,6 +237,15 @@ addsend() {
SEND[$((i++))]="$send"
}
+ifabort() {
+ [[ -n "$1" ]] && log "$@"
+ if [[ -n "$PARENT" && -d "/proc/$PARENT" ]] ; then
+ log "Aborting connection..."
+ kill "$PARENT"
+ fi
+ exit 6
+}
+
main() {
case "$ROLE" in
send)
@@ -274,11 +283,7 @@ main() {
"$CMD" send "$ifc" "$PORT" "${SEND[@]}" || exit 4
"$ping" -q -c1 -W1 -I "$ifc" "$P" &> /dev/null && break
sec_up SEC
- if ((TIMEOUT!=0)) && ((SEC > START+TIMEOUT)) ; then
- log "Time is out."
- [[ -n "$PARENT" && -d "/proc/$PARENT" ]] && kill "$PARENT"
- exit 6
- fi
+ ((TIMEOUT!=0)) && ((SEC > START+TIMEOUT)) && ifabort "Time is out."
done
log "Confirmed, $P is UP."
;;
@@ -319,6 +324,7 @@ main() {
fi
FIRST=0
done
+ ((FIRST==0)) || ifabort "Failed."
log "Completed."
;;
esac
@@ -475,8 +481,8 @@ if [[ -z "$NO6ADDR" ]] ; then
ip -6 route flush dev "$ifc"
fi
-if [[ "$ROLE" = send && -n "$ABORT" && "$ABORT" != 'no' ]] ; then
- read PARENT g < <( ps h -o pid,cmd -C vtund | grep -E " vtund\[s\]: .+ tun $ifc[ ]*\$" )
+if [[ -n "$ABORT" && "$ABORT" != 'no' ]] ; then
+ read PARENT g < <( ps h -o pid,cmd -C vtund | grep -E " vtund\[[sc]\]: .+ tun $ifc[ ]*\$" )
fi
if [[ -n "$NOBG" ]] ; then