vpnbypass: README update, code cleanup
Signed-off-by: Stan Grishin <stangri@melmac.net> update Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
parent
82f8333123
commit
dc09a37913
4 changed files with 31 additions and 14 deletions
|
@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=vpnbypass
|
PKG_NAME:=vpnbypass
|
||||||
PKG_VERSION:=1.3.1
|
PKG_VERSION:=1.3.1
|
||||||
PKG_RELEASE:=7
|
PKG_RELEASE:=9
|
||||||
PKG_LICENSE:=GPL-3.0-or-later
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
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
|
$(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
define Package/vpnbypass/postinst
|
define Package/vpnbypass/postinst
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# check if we are on real system
|
# check if we are on real system
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
<!-- markdownlint-disable MD013 -->
|
||||||
# VPN Bypass
|
# VPN Bypass
|
||||||
|
|
||||||
|
[](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.
|
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
|
## Features
|
||||||
|
@ -14,7 +17,7 @@ A simple [procd](https://openwrt.org/docs/techref/procd)-based ```vpnbypass``` s
|
||||||
|
|
||||||
## Screenshot (luci-app-vpnbypass)
|
## Screenshot (luci-app-vpnbypass)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
@ -57,7 +60,9 @@ opkg update
|
||||||
opkg install vpnbypass luci-app-vpnbypass
|
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
|
## Default Settings
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,27 @@
|
||||||
# shellcheck disable=SC2039,SC1091,SC2086
|
# shellcheck disable=SC2039,SC1091,SC2086
|
||||||
PKG_VERSION='dev-test'
|
PKG_VERSION='dev-test'
|
||||||
|
|
||||||
export START=94
|
# shellcheck disable=SC2034
|
||||||
export USE_PROCD=1
|
START=94
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
|
# shellcheck disable=SC2034
|
||||||
readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
|
EXTRA_COMMANDS='version'
|
||||||
readonly __OK__='\033[0;32m[\xe2\x9c\x93]\033[0m'
|
version() { echo "$PKG_VERSION"; }
|
||||||
readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m'
|
|
||||||
readonly __PASS__='\033[0;33m[-]\033[0m'
|
readonly __ERROR__='\033[0;31mERROR\033[0m'
|
||||||
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 packageName='vpnbypass'
|
||||||
readonly serviceName="$packageName $PKG_VERSION"
|
readonly serviceName="$packageName $PKG_VERSION"
|
||||||
readonly sharedMemoryOutput="/dev/shm/$packageName-output"
|
readonly sharedMemoryOutput="/dev/shm/$packageName-output"
|
||||||
|
@ -122,6 +132,6 @@ service_triggers() {
|
||||||
procd_add_reload_trigger 'firewall' 'openvpn' 'vpnbypass'
|
procd_add_reload_trigger 'firewall' 'openvpn' 'vpnbypass'
|
||||||
procd_open_trigger
|
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;
|
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
|
procd_close_trigger
|
||||||
}
|
}
|
||||||
|
|
3
net/vpnbypass/test.sh
Normal file
3
net/vpnbypass/test.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/etc/init.d/"$1" version 2>&1 | grep "$2"
|
Loading…
Reference in a new issue