Coding-Style; First floor and basement are now the same with the

authentication user
This commit is contained in:
Bandie 2022-04-11 18:47:42 +02:00
parent aadce7fb1a
commit aacb9c9669
Signed by: Bandie
GPG Key ID: F4E0AB327841A877
1 changed files with 33 additions and 56 deletions

View File

@ -49,35 +49,12 @@ rm -f ${temp_outfile}
for appendix in open close door
do
action="$appendix"
if [ "$action" = "door" ]
then
action=""
fi
export action
outfile="${dest}/authorized_keys.${appendix}"
cat ${temp_outfile} |envsubst > ${outfile}
# Oben
if [ "$(hostname)" = "foodoor" ]; then
# Oben und unten
install -d -o ${appendix} -g nogroup -m 0700 /var/lib/foodoor/${appendix}/.ssh
install -b -S .last -o ${appendix} -g nogroup -m 0600 ${outfile} /var/lib/foodoor/${appendix}/.ssh/authorized_keys
fi
# Unten
if [ "$(hostname)" = "kellertuer" ]; then
if [ "${action}" = "open" ]; then
owner="unlock"
elif [ "${action}" = "close" ]; then
owner="lock"
fi
install -d -o ${owner} -g nogroup -m 0700 /var/lib/foodoor/${action}/.ssh
install -b -S .last -o ${owner} -g nogroup -m 0600 ${outfile} /var/lib/foodoor/${action}/.ssh/authorized_keys
if [ "${appendix}" = "door" ]; then
install -d -o ${appendix} -g nogroup -m 0700 /var/lib/foodoor/${appendix}/.ssh
install -b -S .last -o ${appendix} -g nogroup -m 0600 ${outfile} /var/lib/foodoor/${appendix}/.ssh/authorized_keys
fi
fi
done