You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.8 KiB

  1. # Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
  2. # This is free software, licensed under the GNU General Public License v3.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:=vpnbypass
  5. PKG_VERSION:=1.3.2
  6. PKG_RELEASE:=1
  7. PKG_LICENSE:=GPL-3.0-or-later
  8. PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
  9. include $(INCLUDE_DIR)/package.mk
  10. define Package/vpnbypass
  11. SECTION:=net
  12. CATEGORY:=Network
  13. TITLE:=VPN Bypass Service
  14. URL:=https://docs.openwrt.melmac.net/vpnbypass/
  15. DEPENDS:=+ipset +iptables
  16. PKGARCH:=all
  17. endef
  18. define Package/vpnbypass/description
  19. This service can be used to enable simple VPN split tunnelling.
  20. Supports accessing domains, IP ranges outside of your VPN tunnel.
  21. Also supports dedicating local ports/IP ranges for direct
  22. internet access (outside of your VPN tunnel).
  23. Please see the README for further information.
  24. endef
  25. define Package/vpnbypass/conffiles
  26. /etc/config/vpnbypass
  27. endef
  28. define Build/Configure
  29. endef
  30. define Build/Compile
  31. endef
  32. define Package/vpnbypass/install
  33. $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/firewall
  34. $(INSTALL_BIN) ./files/vpnbypass.init $(1)/etc/init.d/vpnbypass
  35. $(SED) "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/vpnbypass
  36. $(INSTALL_CONF) ./files/vpnbypass.config $(1)/etc/config/vpnbypass
  37. $(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
  38. endef
  39. define Package/vpnbypass/postinst
  40. #!/bin/sh
  41. # check if we are on real system
  42. if [ -z "$${IPKG_INSTROOT}" ]; then
  43. /etc/init.d/vpnbypass enable
  44. fi
  45. exit 0
  46. endef
  47. define Package/vpnbypass/prerm
  48. #!/bin/sh
  49. # check if we are on real system
  50. if [ -z "$${IPKG_INSTROOT}" ]; then
  51. echo "Stopping service and removing rc.d symlink for vpnbypass"
  52. /etc/init.d/vpnbypass stop || true
  53. /etc/init.d/vpnbypass disable || true
  54. fi
  55. exit 0
  56. endef
  57. $(eval $(call BuildPackage,vpnbypass))