From cb3b43eb57221154eb1ee09ff79d9e4260b7ed1b Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Wed, 4 Dec 2024 10:32:13 +0700 Subject: [PATCH] netplugd.service --- usr/lib/init/services/netplugd.service | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 usr/lib/init/services/netplugd.service diff --git a/usr/lib/init/services/netplugd.service b/usr/lib/init/services/netplugd.service new file mode 100755 index 0000000..bace93d --- /dev/null +++ b/usr/lib/init/services/netplugd.service @@ -0,0 +1,32 @@ +#!/bin/sh + +#--- import colors and init-funcs --- +. /usr/lib/init/colors.sh +. /usr/lib/init/init-funcs.sh +#------------------------------------ + +start() { + notify "Starting Netplugd" + netplugd -p /var/run/netplugd.pid + check $? "start netplugd" + return $? +} + +stop() { + notify "Stopping Netplugd" + kill $(cat /var/run/netplugd.pid) + check $? "stop Netplugd" + rm /var/run/netplugd.pid &> /dev/null + return $? +} + +case "$1" in + start|stop|restart|reload|help) + "$1" + ;; + *) + help + ;; +esac +return $? +