#!/bin/bash -- # shold be started from a separate account # access via ssh: # cat .ssh/authorized_keys # command="/home/automation/chch-power/shell.sh",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA... status() { STATUS="$(cat /tmp/status)" if [ -z "$STATUS" ]; then STATUS="geschlossen" fi echo "$STATUS" } read COMMAND case "$COMMAND" in status) status ;; *) echo "ERROR; available commands:" >&2 echo "status" >&2 exit 1 ;; esac exit 0