switched to implementation with pipe due to possible race conditions

This commit is contained in:
root 2017-02-23 11:49:57 +00:00
parent 79098d7e62
commit 468576ecd0
2 changed files with 10 additions and 13 deletions

View file

@ -6,8 +6,10 @@
# command="/home/automation/chch-power/shell.sh",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA...
COMMAND_FILE=/tmp/command
touch $COMMAND_FILE
chmod -f 666 $COMMAND_FILE
if [ ! -p $COMMAND_FILE ]; then
echo "ERROR; command watcher not listening:" >&2
exit 1
fi
status() {
STATUS="$(cat /tmp/status)"