vpnbypass: README update, code cleanup
authorStan Grishin <stangri@melmac.net>
Mon, 21 Sep 2020 18:15:40 +0000 (18:15 +0000)
committerPaul Spooren <mail@aparcar.org>
Tue, 22 Sep 2020 09:04:55 +0000 (23:04 -1000)
Signed-off-by: Stan Grishin <stangri@melmac.net>
update

Signed-off-by: Stan Grishin <stangri@melmac.net>
net/vpnbypass/Makefile
net/vpnbypass/files/README.md
net/vpnbypass/files/vpnbypass.init
net/vpnbypass/test.sh [new file with mode: 0644]

index d2090f28ee1b045bf02a8942fd027feb831ac954..41a8c99a2803dd09f12bebd2ee8a4ca64fc15274 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vpnbypass
 PKG_VERSION:=1.3.1
-PKG_RELEASE:=7
+PKG_RELEASE:=9
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
 
@@ -52,7 +52,6 @@ define Package/vpnbypass/install
        $(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
 endef
 
-
 define Package/vpnbypass/postinst
        #!/bin/sh
        # check if we are on real system
index 9925bed3f13389b92bda917c7cb9e823b4d8fa80..50fdb8c927225d72846e593db48aba70f30fb9b6 100644 (file)
@@ -1,5 +1,8 @@
+<!-- markdownlint-disable MD013 -->
 # VPN Bypass
 
+[![HitCount](http://hits.dwyl.com/stangri/openwrt/vpnbypass.svg)](http://hits.dwyl.com/stangri/openwrt/vpnbypass)
+
 A simple [procd](https://openwrt.org/docs/techref/procd)-based ```vpnbypass``` service for OpenWrt/LEDE Project. This is useful if your router accesses Internet through a VPN client/tunnel, but you want specific traffic (ports, IP ranges, domains or local IP ranges) to be routed outside of this tunnel.
 
 ## Features
@@ -14,7 +17,7 @@ A simple [procd](https://openwrt.org/docs/techref/procd)-based ```vpnbypass``` s
 
 ## Screenshot (luci-app-vpnbypass)
 
-![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/vpnbypass/screenshot02.png "screenshot")
+![screenshot](https://cdn.jsdelivr.net/gh/stangri/openwrt_packages/screenshots/vpnbypass/screenshot02.png "screenshot")
 
 ## Requirements
 
@@ -57,7 +60,9 @@ opkg update
 opkg install vpnbypass luci-app-vpnbypass
 ```
 
-If these packages are not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to [add a custom repo to your router](https://github.com/stangri/openwrt_packages/blob/master/README.md#on-your-router) first.
+If these packages are not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to add a custom repo to your router following instructions on [GitHub](https://github.com/stangri/openwrt_packages/blob/master/README.md#on-your-router)/[jsDelivr](https://cdn.jsdelivr.net/gh/stangri/openwrt_packages/README.md#on-your-router) first.
+
+These packages have been designed to be backwards compatible with OpenWrt 19.07, OpenWrt 18.06, LEDE Project 17.01 and OpenWrt 15.05. However, on systems older than OpenWrt 18.06.6 and/or a system which has deviated too far (or haven't been updated to keep in-sync) with official OpenWrt release you may get a message about missing ```luci-compat``` dependency, which (and only which) you can safely ignore and force-install the luci app using ```opkg install --force-depends``` command instead of ```opkg install```.
 
 ## Default Settings
 
index a5b4f15655b8b28fcb7b9ef26f0dde3fb2ed9353..c64654a8a48b4de675e7e57899dbfd4d8cf0d21f 100644 (file)
@@ -3,17 +3,27 @@
 # shellcheck disable=SC2039,SC1091,SC2086
 PKG_VERSION='dev-test'
 
-export START=94
-export USE_PROCD=1
+# shellcheck disable=SC2034
+START=94
+# shellcheck disable=SC2034
+USE_PROCD=1
 
-readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
-readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
-readonly __OK__='\033[0;32m[\xe2\x9c\x93]\033[0m'
-readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m'
-readonly __PASS__='\033[0;33m[-]\033[0m'
-readonly _ERROR_='\033[0;31mERROR\033[0m'
+# shellcheck disable=SC2034
+EXTRA_COMMANDS='version'
+version() { echo "$PKG_VERSION"; }
+
+readonly __ERROR__='\033[0;31mERROR\033[0m'
+
+# shellcheck disable=SC2034
+serviceEnabled=0
+verbosity=2
+TID='200'
+IPSET='vpnbypass'
+FW_MARK='0x010000'
+FW_MASK='0xff0000'
+wan_if4=''
+wan_gw=''
 
-export serviceEnabled verbosity=2 TID='200' IPSET='vpnbypass' FW_MARK='0x010000' FW_MASK='0xff0000' wan_if4 wan_gw
 readonly packageName='vpnbypass'
 readonly serviceName="$packageName $PKG_VERSION"
 readonly sharedMemoryOutput="/dev/shm/$packageName-output"
@@ -122,6 +132,6 @@ service_triggers() {
                procd_add_reload_trigger 'firewall' 'openvpn' 'vpnbypass'
                procd_open_trigger
                        for n in $ifaces; do procd_add_reload_interface_trigger "$n"; procd_add_interface_trigger "interface.*" "$n" /etc/init.d/vpnbypass reload; done;
-                       output "$serviceName monitoring interfaces: $ifaces $_OK_\\n"
+                       output "$serviceName monitoring interfaces: $ifaces\\n"
                procd_close_trigger
 }
diff --git a/net/vpnbypass/test.sh b/net/vpnbypass/test.sh
new file mode 100644 (file)
index 0000000..e51c480
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/etc/init.d/"$1" version 2>&1 | grep "$2"
\ No newline at end of file