From 81c49763ec4c1958c6b54fe383fe931f7aedf456 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 16:48:58 +0800 Subject: [PATCH] update 05-10 16:48:58 --- MentoHUST-OpenWrt-ipk/Makefile | 9 ++++----- .../{src => files}/mentohust.conf | 0 MentoHUST-OpenWrt-ipk/files/mentohust.init | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) rename MentoHUST-OpenWrt-ipk/{src => files}/mentohust.conf (100%) create mode 100644 MentoHUST-OpenWrt-ipk/files/mentohust.init diff --git a/MentoHUST-OpenWrt-ipk/Makefile b/MentoHUST-OpenWrt-ipk/Makefile index a7d080405..df278ad77 100644 --- a/MentoHUST-OpenWrt-ipk/Makefile +++ b/MentoHUST-OpenWrt-ipk/Makefile @@ -11,7 +11,6 @@ PKG_NAME:=mentohust PKG_VERSION:=0.3.1 PKG_RELEASE:=1 - PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -29,7 +28,7 @@ endef define Package/mentohust/description A Ruijie Client Daemon, -Most usually used in China collages. +Most usually used in Chinese universities. endef define Build/Prepare @@ -38,7 +37,6 @@ define Build/Prepare $(SED) 's/dhclient/udhcpc -i/g' $(PKG_BUILD_DIR)/myconfig.c endef - define Package/mentohust/conffiles /etc/mentohust.conf endef @@ -56,8 +54,9 @@ define Package/mentohust/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/mentohust $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc - $(INSTALL_CONF) $(PKG_BUILD_DIR)/mentohust.conf $(1)/etc/mentohust.conf - + $(INSTALL_CONF) ./files/mentohust.conf $(1)/etc/mentohust.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mentohust.init $(1)/etc/init.d/mentohust endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/MentoHUST-OpenWrt-ipk/src/mentohust.conf b/MentoHUST-OpenWrt-ipk/files/mentohust.conf similarity index 100% rename from MentoHUST-OpenWrt-ipk/src/mentohust.conf rename to MentoHUST-OpenWrt-ipk/files/mentohust.conf diff --git a/MentoHUST-OpenWrt-ipk/files/mentohust.init b/MentoHUST-OpenWrt-ipk/files/mentohust.init new file mode 100644 index 000000000..e421a59ce --- /dev/null +++ b/MentoHUST-OpenWrt-ipk/files/mentohust.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=01 + +USE_PROCD=1 +PROG=/usr/sbin/mentohust + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} + +stop_service() { + "$PROG" -k +}