79082689

Date: 2024-10-13 08:05:47
Score: 0.5
Natty:
Report link

What you can try to filter the output for the word "running" or execute myDaemon start to start the daemon. Otherwise, show the correct way to run the myDaemon script.

DAEMON="/etc/init.d/myDaemon"

case "$1" in
    start)
        if "$DAEMON" status | grep -q "running"; then
            echo "Service already running"
        else
            "$DAEMON" start
            echo "Daemon has been started"
        fi
        ;;
    *)
        echo "Usage: $0 {start}"
        ;;
esac
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What you can
  • Low reputation (0.5):
Posted by: Shelton Liu