From 3f59acbfb0d443ab8eaeb2332a3e26d436e5b50d Mon Sep 17 00:00:00 2001 From: Zehka Date: Sun, 7 Nov 2021 18:31:48 +0100 Subject: [PATCH] fixed buggy bugs --- foodoor-trigger | 37 ------------------------------------- foodoor-update-keydb | 4 ++-- 2 files changed, 2 insertions(+), 39 deletions(-) delete mode 100755 foodoor-trigger diff --git a/foodoor-trigger b/foodoor-trigger deleted file mode 100755 index 46f09e7..0000000 --- a/foodoor-trigger +++ /dev/null @@ -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 diff --git a/foodoor-update-keydb b/foodoor-update-keydb index cfaca88..f0c3b6c 100755 --- a/foodoor-update-keydb +++ b/foodoor-update-keydb @@ -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