fixed buggy bugs
This commit is contained in:
parent
98f31f6965
commit
3f59acbfb0
@ -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
|
@ -49,14 +49,14 @@ rm -f ${temp_outfile}
|
||||
for appendix in open close door
|
||||
do
|
||||
action="$appendix"
|
||||
if [ "$action" -eq "door" ]
|
||||
if [ "$action" = "door" ]
|
||||
then
|
||||
action=""
|
||||
fi
|
||||
|
||||
export action
|
||||
outfile="${dest}/authorized_keys.${appendix}"
|
||||
cat ${tmp_outfile} |envsubst > ${outfile}
|
||||
cat ${temp_outfile} |envsubst > ${outfile}
|
||||
|
||||
# Oben
|
||||
install -d -o ${appendix} -g nogroup -m 0700 /var/lib/foodoor/${appendix}/.ssh
|
||||
|
Loading…
Reference in New Issue
Block a user