switched to implementation with pipe due to possible race conditions
This commit is contained in:
parent
79098d7e62
commit
468576ecd0
2 changed files with 10 additions and 13 deletions
6
shell.sh
6
shell.sh
|
@ -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)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue