Use -e instead of -f when checking for Keyfile

Why? Because we can use FD in place of regular files. Like this:
root@backup:~# bkctld key test <(echo "ssh-rsa AA...")
Update test : key = /dev/fd/63
This commit is contained in:
Benoît S. 2017-08-18 14:41:15 +02:00 committed by Victor LABORIE
parent ea5362ca2a
commit 2f8b655fa6

2
bkctld
View file

@ -106,7 +106,7 @@ set_port() {
set_key() {
jail=$1
keyfile=$2
if [ -f $keyfile ]; then
if [ -e $keyfile ]; then
cat $keyfile > ${JAILDIR}/${jail}/${AUTHORIZED_KEYS}
chmod 600 ${JAILDIR}/${jail}/${AUTHORIZED_KEYS}
else