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.

63 lines
2.0 KiB

  1. #
  2. # Copyright (C) 2015 Bruno Randolf (br1@einfach.org)
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=pingcheck
  9. PKG_VERSION:=2020-02-12
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_MIRROR_HASH:=3890cd39add7e523ab7418faf6a7ae1a1f71d2739982e6e09aa33cc6defac8be
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_URL:=https://github.com/br101/pingcheck
  15. PKG_SOURCE_PROTO:=git
  16. PKG_SOURCE_VERSION:=520718f9377eab49888a3e38ece59f9ad94d978e
  17. PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
  18. PKG_LICENSE:=GPL-2.0-or-later
  19. PKG_LICENSE_FILES:=LICENSE
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/pingcheck
  23. SECTION:=net
  24. CATEGORY:=Network
  25. DEPENDS:=+libubus +libuci
  26. MAINTAINER:=Bruno Randolf <br1@einfach.org>
  27. TITLE:=Check Internet and interface connectivity
  28. URL:=https://github.com/br101/pingcheck
  29. endef
  30. define Package/pingcheck/description
  31. Checks by using "ping" (ICMP echo) or by opening connections to TCP port 80
  32. whether a configured host (normally on the internet) can be reached via a
  33. specific interface. Then makes this information available via ubus and triggers
  34. "online" and "offline" scripts.
  35. endef
  36. define Package/pingcheck/conffiles
  37. /etc/config/pingcheck
  38. endef
  39. define Package/pingcheck/install
  40. $(INSTALL_DIR) $(1)/usr/sbin
  41. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/pingcheck $(1)/usr/sbin/
  42. $(INSTALL_DIR) $(1)/etc/init.d
  43. $(INSTALL_BIN) ./pingcheck.init $(1)/etc/init.d/pingcheck
  44. $(INSTALL_DIR) $(1)/etc/config
  45. $(INSTALL_DATA) $(PKG_BUILD_DIR)/pingcheck.config $(1)/etc/config/pingcheck
  46. $(INSTALL_DIR) $(1)/etc/pingcheck/online.d/
  47. $(INSTALL_DIR) $(1)/etc/pingcheck/offline.d/
  48. $(INSTALL_DIR) $(1)/etc/pingcheck/panic.d/
  49. $(INSTALL_DATA) $(PKG_BUILD_DIR)/example-script.sh $(1)/etc/pingcheck/online.d/
  50. $(INSTALL_DATA) $(PKG_BUILD_DIR)/example-script.sh $(1)/etc/pingcheck/offline.d/
  51. endef
  52. $(eval $(call BuildPackage,pingcheck))