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.

61 lines
1.9 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:=2022-03-01
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/br101/pingcheck
  13. PKG_SOURCE_VERSION:=13b63da97696806ec68638e006ae4fe421f579ae
  14. PKG_MIRROR_HASH:=5d833681db6e5f168bd275d6c99f80f9758f21f7ee5d8d66b536361ad740af4d
  15. PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
  16. PKG_LICENSE:=GPL-2.0-or-later
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/pingcheck
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+libubus +libuci
  24. MAINTAINER:=Bruno Randolf <br1@einfach.org>
  25. TITLE:=Check Internet and interface connectivity
  26. URL:=https://github.com/br101/pingcheck
  27. endef
  28. define Package/pingcheck/description
  29. Checks by using "ping" (ICMP echo) or by opening connections to TCP port 80
  30. whether a configured host (normally on the internet) can be reached via a
  31. specific interface. Then makes this information available via ubus and triggers
  32. "online" and "offline" scripts.
  33. endef
  34. define Package/pingcheck/conffiles
  35. /etc/config/pingcheck
  36. endef
  37. define Package/pingcheck/install
  38. $(INSTALL_DIR) $(1)/usr/sbin
  39. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/pingcheck $(1)/usr/sbin/
  40. $(INSTALL_DIR) $(1)/etc/init.d
  41. $(INSTALL_BIN) ./pingcheck.init $(1)/etc/init.d/pingcheck
  42. $(INSTALL_DIR) $(1)/etc/config
  43. $(INSTALL_DATA) $(PKG_BUILD_DIR)/pingcheck.config $(1)/etc/config/pingcheck
  44. $(INSTALL_DIR) $(1)/etc/pingcheck/online.d/
  45. $(INSTALL_DIR) $(1)/etc/pingcheck/offline.d/
  46. $(INSTALL_DIR) $(1)/etc/pingcheck/panic.d/
  47. $(INSTALL_DATA) $(PKG_BUILD_DIR)/example-script.sh $(1)/etc/pingcheck/online.d/
  48. $(INSTALL_DATA) $(PKG_BUILD_DIR)/example-script.sh $(1)/etc/pingcheck/offline.d/
  49. endef
  50. $(eval $(call BuildPackage,pingcheck))