quietly change permissions on the command file
(allows both accounts to do modifications)
This commit is contained in:
parent
e177bedd69
commit
79098d7e62
|
@ -13,7 +13,7 @@ lounge_light_toggle() {
|
||||||
|
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
touch "$COMMAND_FILE"
|
touch "$COMMAND_FILE"
|
||||||
chmod 666 "$COMMAND_FILE"
|
chmod -f 666 "$COMMAND_FILE"
|
||||||
while inotifywait -qq -e close_write "$COMMAND_FILE"; do
|
while inotifywait -qq -e close_write "$COMMAND_FILE"; do
|
||||||
mv "$COMMAND_FILE" "$COMMAND_FILE_TMP"
|
mv "$COMMAND_FILE" "$COMMAND_FILE_TMP"
|
||||||
sleep .1 # wait for possible further/parallel writes to end
|
sleep .1 # wait for possible further/parallel writes to end
|
||||||
|
@ -34,5 +34,5 @@ while inotifywait -qq -e close_write "$COMMAND_FILE"; do
|
||||||
done < "$COMMAND_FILE_TMP"
|
done < "$COMMAND_FILE_TMP"
|
||||||
rm "$COMMAND_FILE_TMP"
|
rm "$COMMAND_FILE_TMP"
|
||||||
touch "$COMMAND_FILE"
|
touch "$COMMAND_FILE"
|
||||||
chmod 666 "$COMMAND_FILE"
|
chmod -f 666 "$COMMAND_FILE"
|
||||||
done
|
done
|
||||||
|
|
2
shell.sh
2
shell.sh
|
@ -6,6 +6,8 @@
|
||||||
# command="/home/automation/chch-power/shell.sh",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA...
|
# 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
|
COMMAND_FILE=/tmp/command
|
||||||
|
touch $COMMAND_FILE
|
||||||
|
chmod -f 666 $COMMAND_FILE
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
STATUS="$(cat /tmp/status)"
|
STATUS="$(cat /tmp/status)"
|
||||||
|
|
Loading…
Reference in New Issue