mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 17:01:14 +00:00
add dropkey ssh keys and config files to the conffiles section (#2014)
SVN-Revision: 14399
This commit is contained in:
parent
59ff6c01d8
commit
a377aa9ab5
@ -35,6 +35,12 @@ define Package/dropbear/description
|
|||||||
A small SSH2 server/client designed for small memory environments.
|
A small SSH2 server/client designed for small memory environments.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/dropbear/conffiles
|
||||||
|
/etc/dropbear/dropbear_rsa_host_key
|
||||||
|
/etc/dropbear/dropbear_dss_host_key
|
||||||
|
/etc/config/dropbear
|
||||||
|
endef
|
||||||
|
|
||||||
define Package/dropbearconvert
|
define Package/dropbearconvert
|
||||||
$(call Package/dropbear/Default)
|
$(call Package/dropbear/Default)
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
@ -89,8 +95,9 @@ define Package/dropbear/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
|
$(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/opkg/info
|
$(INSTALL_DIR) $(1)/usr/lib/opkg/info
|
||||||
echo /etc/dropbear/dropbear_rsa_host_key > $(1)/usr/lib/opkg/info/dropbear.conffiles
|
$(INSTALL_DIR) $(1)/etc/dropbear
|
||||||
echo /etc/dropbear/dropbear_dss_host_key >> $(1)/usr/lib/opkg/info/dropbear.conffiles
|
touch $(1)/etc/dropbear/dropbear_rsa_host_key
|
||||||
|
touch $(1)/etc/dropbear/dropbear_dss_host_key
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/dropbearconvert/install
|
define Package/dropbearconvert/install
|
||||||
|
@ -26,7 +26,7 @@ keygen() {
|
|||||||
for keytype in rsa dss; do
|
for keytype in rsa dss; do
|
||||||
# check for keys
|
# check for keys
|
||||||
key=dropbear/dropbear_${keytype}_host_key
|
key=dropbear/dropbear_${keytype}_host_key
|
||||||
[ -f /tmp/$key -o -f /etc/$key ] || {
|
[ -f /tmp/$key -o -s /etc/$key ] || {
|
||||||
# generate missing keys
|
# generate missing keys
|
||||||
mkdir -p /tmp/dropbear
|
mkdir -p /tmp/dropbear
|
||||||
[ -x /usr/bin/dropbearkey ] && {
|
[ -x /usr/bin/dropbearkey ] && {
|
||||||
@ -45,8 +45,8 @@ keygen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
[ -f /etc/dropbear/dropbear_rsa_host_key -a \
|
[ -s /etc/dropbear/dropbear_rsa_host_key -a \
|
||||||
-f /etc/dropbear/dropbear_dss_host_key ] || keygen
|
-s /etc/dropbear/dropbear_dss_host_key ] || keygen
|
||||||
|
|
||||||
config_load dropbear
|
config_load dropbear
|
||||||
/usr/sbin/dropbear $DROPBEAR_ARGS
|
/usr/sbin/dropbear $DROPBEAR_ARGS
|
||||||
|
Loading…
Reference in New Issue
Block a user