diff --git a/etc-init.d-iperfd b/etc-init.d-iperfd new file mode 100644 index 0000000..bea2d8e --- /dev/null +++ b/etc-init.d-iperfd @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# (C) 2019 - 2023 Fernao Vellozo +# This is free software under the terms of GPLv3 + +START=90 +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Check service status" + +boot() { + /usr/bin/iperfd + logger ".. iperf3 daemon started on boot .." +} + +start() { + /usr/bin/iperfd + logger ".. iperf3 daemon started .." +} + +restart() { + logger ".. iperf3 daemon restarting .." + killall iperf3 + /usr/bin/iperfd + logger ".. iperf3 daemon restarted .." +} + +stop() { + killall iperf3 + logger ".. iperf3 daemon stopped .." +} + +status() { + ps | grep iperf3 | grep -v grep > /dev/null 2>&1 + if [ $? = 0 ]; + then echo ".. iperf3 daemon is running .." + else echo ".. iperf3 daemon is NOT running .." + fi +} \ No newline at end of file