mirror of
https://github.com/unraid/webgui.git
synced 2026-01-15 06:00:14 -06:00
31 lines
565 B
Bash
Executable File
31 lines
565 B
Bash
Executable File
#!/bin/sh
|
|
|
|
script="diskload"
|
|
daemon="/usr/local/emhttp/webGui/scripts/$script"
|
|
|
|
case $1 in
|
|
start)
|
|
if [[ -z $(pgrep -f $daemon) ]]; then
|
|
$daemon 1>/dev/null 2>&1
|
|
echo "$script started"
|
|
else
|
|
echo "$script already running!"
|
|
fi
|
|
;;
|
|
stop)
|
|
if [[ -n $(pgrep -f $daemon) ]]; then
|
|
pkill -f $daemon 1>/dev/null 2>&1
|
|
timer=5
|
|
until [[ -z $(pgrep -f $daemon) || $timer -eq 0 ]]; do
|
|
((timer--))
|
|
sleep 1
|
|
done
|
|
echo "$script stopped"
|
|
else
|
|
echo "$script not running!"
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: $(basename $0) start|stop"
|
|
esac
|