Skip to content

Commit 0d8a441

Browse files
committed
Improved logic check for SSH keys
1 parent a1c05b8 commit 0d8a441

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/etc/s6-overlay/scripts/generate-ssh-keys

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ $DEBUG_MODE == true ]; then
55
fi
66

77
# Check if SSH host keys are missing
8-
if [ $(find /etc/ssh/ssh_host_keys/ -maxdepth 1 -name "ssh_host_*" | wc -l) -ne 3 ]; then
8+
if [ ! -f $SSH_HOST_KEY_DIR/ssh_host_rsa_key ] || [ ! -f $SSH_HOST_KEY_DIR/ssh_host_ecdsa_key ] || [ ! -f $SSH_HOST_KEY_DIR/ssh_host_ed25519_key ]; then
99
echo "🏃‍♂️ Generating SSH keys for you..."
1010
dpkg-reconfigure openssh-server
1111
# Check if the host directory exists. Create it if needed

0 commit comments

Comments
 (0)