#!/bin/sh

# This is an example for systemd-notify
# You can see the status with systemctl status demoservice3.service


PIPE="/tmp/foo"
if [ ! -p "$PIPE" ]; then
        mkfifo  -m 666 $PIPE
fi

sleep 10  # Assume we are doing some time consuming initialization

# Notify systemd that we are ready
systemd-notify --ready --status="Waiting for data ..."

while : ; do
        read a < /tmp/foo
        # Tell systemd your current status
        systemd-notify --status="Processing $a"

        # Do something with $a …
        sleep 10

        systemd-notify --status="Waiting for data ..."
done


