#!/bin/sh
# Stands in for systemd. Records the argv, then answers the way the real thing
# would for the one unit that exists and for anything else.
echo "$@" >> /tmp/systemctl.log
case "$2" in
  tnkr-robot)
    if [ "$1" = "status" ]; then
      echo "● tnkr-robot.service - Tnkr robot runtime"
      echo "     Loaded: loaded (/etc/systemd/system/tnkr-robot.service; enabled)"
      echo "     Active: active (running)"
    fi
    exit 0
    ;;
  *)
    # An unknown unit. systemd exits 5 here, and the CLI has to say something
    # readable rather than passing a bare 5 to the operator.
    echo "Unit $2 could not be found." >&2
    exit 5
    ;;
esac
