Automatisches foo

This commit is contained in:
Bandie 2021-11-07 19:45:39 +01:00
parent 3f59acbfb0
commit a104fbf913

View File

@ -58,18 +58,26 @@ do
outfile="${dest}/authorized_keys.${appendix}"
cat ${temp_outfile} |envsubst > ${outfile}
# Oben
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
# Oben
if [ "$(hostname)" = "foodoor" ]; 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
# Unten
#if [ "${action}" = "open" ]; then
# owner="unlock"
#elif [ "${action}" = "close" ]; then
# owner="lock"
#fi
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
#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
done