mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
package/skeleton-init-finit: sync OpenSSH support from myLinux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -45,6 +45,14 @@ endef
|
||||
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_DROPBEAR
|
||||
endif
|
||||
|
||||
# OpenSSH
|
||||
ifeq ($(BR2_PACKAGE_OPENSSH),y)
|
||||
define SKELETON_INIT_FINIT_SET_OPENSSH
|
||||
ln -sf ../available/sshd.conf $(FINIT_D)/enabled/sshd.conf
|
||||
endef
|
||||
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_OPENSSH
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LLDPD),y)
|
||||
define SKELETON_INIT_FINIT_SET_LLDPD
|
||||
ln -sf ../available/lldpd.conf $(FINIT_D)/enabled/lldpd.conf
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
task [S] /usr/bin/ssh-genhostkeys --
|
||||
service [2345789] <usr/ssh-hostkeys> env:-/etc/default/sshd /usr/sbin/sshd -D $SSHD_OPTS -- OpenSSH daemon
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
if sshd -t; then
|
||||
initctl cond set ssh-hostkeys
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if sshd -t 2>&1 |grep hostkeys; then
|
||||
ssh-keygen -A
|
||||
initctl cond set ssh-hostkeys
|
||||
else
|
||||
logger -t sshd "invadlid sshd_config, check with: sshd -t"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user