Procházet zdrojové kódy

pingcheck: Add new package

Pingcheck is a daemon for OpenWRT which checks the online status of individual
network interfaces and makes this information available via UBUS and by
triggering "online" and "offline" scripts.

It is maintained at: https://github.com/br101/pingcheck

Signed-off-by: Bruno Randolf <br1@einfach.org>
Bruno Randolf před 9 roky
rodič
revize
e221605078
2 změnil soubory, kde provedl 70 přidání a 0 odebrání
  1. 55
    0
      net/pingcheck/Makefile
  2. 15
    0
      net/pingcheck/pingcheck.init

+ 55
- 0
net/pingcheck/Makefile Zobrazit soubor

@@ -0,0 +1,55 @@
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
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=pingcheck
11
+PKG_VERSION:=0.1
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16
+PKG_SOURCE_URL:=https://github.com/br101/pingcheck.git
17
+PKG_SOURCE_PROTO:=git
18
+PKG_SOURCE_VERSION:=0f099998782f550e2abebdc65bcc3e969b798769
19
+
20
+PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
21
+PKG_LICENSE:=GPL-2.0+
22
+PKG_LICENSE_FILES:=LICENSE
23
+
24
+PKG_BUILD_PARALLEL:=1
25
+
26
+include $(INCLUDE_DIR)/package.mk
27
+
28
+define Package/pingcheck
29
+	SECTION:=net
30
+	CATEGORY:=Network
31
+	DEPENDS:=+libubus +libuci
32
+	MAINTAINER:=Bruno Randolf <br1@einfach.org>
33
+	TITLE:=Check Internet and interface connectivity
34
+endef
35
+
36
+define Package/pingcheck/description
37
+Checks by using "ping" (ICMP echo) wether a configured host (normally on the
38
+internet) can be reached via a specific interface. Then makes this information
39
+available via ubus and triggers "online" and "offline" scripts.
40
+endef
41
+
42
+define Package/pingcheck/conffiles
43
+/etc/config/pingcheck
44
+endef
45
+
46
+define Package/pingcheck/install
47
+	$(INSTALL_DIR) $(1)/usr/sbin
48
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/pingcheck $(1)/usr/sbin/
49
+	$(INSTALL_DIR) $(1)/etc/init.d
50
+	$(INSTALL_BIN) ./pingcheck.init $(1)/etc/init.d/pingcheck
51
+	$(INSTALL_DIR) $(1)/etc/config
52
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/pingcheck.config $(1)/etc/config/pingcheck
53
+endef
54
+
55
+$(eval $(call BuildPackage,pingcheck))

+ 15
- 0
net/pingcheck/pingcheck.init Zobrazit soubor

@@ -0,0 +1,15 @@
1
+#!/bin/sh /etc/rc.common
2
+
3
+START=99
4
+
5
+USE_PROCD=1
6
+PROG=/usr/sbin/pingcheck
7
+CONFFILE=/etc/config/pingcheck
8
+
9
+start_service() {
10
+	procd_open_instance
11
+	procd_set_param command $PROG
12
+	procd_set_param file $CONFFILE
13
+	procd_set_param respawn
14
+	procd_close_instance
15
+}