fixed buggy bugs

This commit is contained in:
Zehka 2021-11-07 18:31:48 +01:00
parent 98f31f6965
commit 3f59acbfb0
2 changed files with 2 additions and 39 deletions

View File

@ -1,37 +0,0 @@
#!/bin/sh
set -e
PIPE_PATH=/var/run/foodoord.pipe
if [ ! -e $PIPE_PATH ]
then
echo "Pipe missing. Check daemon status."
exit 1
fi
action="$1"
isTriggerActivated="0"
if [ -z "$action" ]
then
action="$SSH_ORIGINAL_COMMAND"
isTriggerActivated="1"
fi
case $action in
close|open)
echo $action | tee $PIPE_PATH > /tmp/state
;;
status)
;;
*)
echo "Usage: $(basename $0) { close, open, status }"
exit 1
;;
esac
if [ $isTriggerActivated -eq 1 ]
then
cat /tmp/state
sleep 2
fi

View File

@ -49,14 +49,14 @@ rm -f ${temp_outfile}
for appendix in open close door for appendix in open close door
do do
action="$appendix" action="$appendix"
if [ "$action" -eq "door" ] if [ "$action" = "door" ]
then then
action="" action=""
fi fi
export action export action
outfile="${dest}/authorized_keys.${appendix}" outfile="${dest}/authorized_keys.${appendix}"
cat ${tmp_outfile} |envsubst > ${outfile} cat ${temp_outfile} |envsubst > ${outfile}
# Oben # Oben
install -d -o ${appendix} -g nogroup -m 0700 /var/lib/foodoor/${appendix}/.ssh install -d -o ${appendix} -g nogroup -m 0700 /var/lib/foodoor/${appendix}/.ssh