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

View File

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