Browse Source

openssh: provide an avahi service file

As discussed in #543, we can announce the SFTP service via Avahi
when sftp-server is installed.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
lilik-openwrt-22.03
Michael Heimpold 10 years ago
parent
commit
1c6580d05d
2 changed files with 32 additions and 2 deletions
  1. +23
    -2
      net/openssh/Makefile
  2. +9
    -0
      net/openssh/files/sftp-ssh.service

+ 23
- 2
net/openssh/Makefile View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2011 OpenWrt.org
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openssh
PKG_VERSION:=6.7p1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
@ -131,6 +131,21 @@ define Package/openssh-sftp-server/description
OpenSSH SFTP server.
endef
define Package/openssh-sftp-avahi-service
$(call Package/openssh/Default)
TITLE+= (SFTP Avahi service)
DEPENDS:=+openssh-sftp-server +avahi-daemon
endef
define Package/openssh-sftp-avahi-service/description
This package contains the service definition for announcing
SFTP support via mDNS/DNS-SD.
endef
define Package/openssh-sftp-avahi-service/conffiles
/etc/avahi/services/sftp-ssh.service
endef
CONFIGURE_ARGS+= \
$(DISABLE_NLS) \
--sysconfdir=/etc/ssh \
@ -259,6 +274,11 @@ define Package/openssh-sftp-server/install
ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
endef
define Package/openssh-sftp-avahi-service/install
$(INSTALL_DIR) $(1)/etc/avahi/services
$(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
endef
$(eval $(call BuildPackage,openssh-client))
$(eval $(call BuildPackage,openssh-moduli))
$(eval $(call BuildPackage,openssh-client-utils))
@ -267,3 +287,4 @@ $(eval $(call BuildPackage,openssh-server))
$(eval $(call BuildPackage,openssh-server-pam))
$(eval $(call BuildPackage,openssh-sftp-client))
$(eval $(call BuildPackage,openssh-sftp-server))
$(eval $(call BuildPackage,openssh-sftp-avahi-service))

+ 9
- 0
net/openssh/files/sftp-ssh.service View File

@ -0,0 +1,9 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_sftp-ssh._tcp</type>
<port>22</port>
</service>
</service-group>

Loading…
Cancel
Save