Add support for config file
This commit is contained in:
parent
368afcdfd9
commit
b9e033da09
4 changed files with 21 additions and 4 deletions
6
PKGBUILD
6
PKGBUILD
|
@ -18,13 +18,15 @@ source=(
|
|||
"dropbear_install"
|
||||
"LICENSE"
|
||||
)
|
||||
backup=( "etc/dropbear/config" )
|
||||
changelog=ChangeLog
|
||||
sha256sums=('6c529408125bd0c446162f8d4a16d7262d6b39896d8e6f87d364f7b299203315'
|
||||
'6e6fcb6a1f3b1ffae85a8b72b56b8fd2b221777713d221641d8cbfd2ad5637b3'
|
||||
sha256sums=('9852ab6a3ba4191ed3eabbfebb2876fe7ff1003f62309043ec0b8b9374e3b9ee'
|
||||
'3f6cb2c6edd2a5510e9d2366b68815b0d0f9d7cfc066c26c4b842af44d2024fd'
|
||||
'ac69d63ecc672c698582b0fc260dbfe42d71adcdab707f807c8e1113be11abd8')
|
||||
|
||||
package() {
|
||||
install -Dm0644 dropbear_hook "$pkgdir/usr/lib/initcpio/hooks/dropbear"
|
||||
install -Dm0644 dropbear_install "$pkgdir/usr/lib/initcpio/install/dropbear"
|
||||
install -Dm0644 dropbear_config "$pkgdir/etc/dropbear/config"
|
||||
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
|
||||
}
|
||||
|
|
1
dropbear_config
Normal file
1
dropbear_config
Normal file
|
@ -0,0 +1 @@
|
|||
DROPBEAR_PORT=22
|
|
@ -4,8 +4,15 @@ run_hook() {
|
|||
[ -d /dev/pts ] || mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
|
||||
echo "Starting dropbear"
|
||||
/usr/sbin/dropbear -E -s -j -k
|
||||
if [ -s /etc/dropbear/config ]; then
|
||||
echo "Found dropbear config file"
|
||||
. /etc/dropbear/config
|
||||
fi
|
||||
|
||||
port=${DROPBEAR_PORT:-22}
|
||||
|
||||
echo "Starting dropbear on port $port"
|
||||
/usr/sbin/dropbear -E -s -j -k -p "$port"
|
||||
}
|
||||
|
||||
run_cleanuphook() {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
CONFIG_FILE="/etc/dropbear/config"
|
||||
KEY_TYPES="ed25519 ecdsa rsa"
|
||||
|
||||
get_fingerprint() {
|
||||
|
@ -83,6 +84,12 @@ build() {
|
|||
add_dir "/var/log"
|
||||
touch "${BUILDROOT}"/var/log/lastlog
|
||||
|
||||
if [ -s $CONFIG_FILE ]; then
|
||||
echo "Using config file $CONFIG_FILE:"
|
||||
cat $CONFIG_FILE
|
||||
add_file $CONFIG_FILE
|
||||
fi
|
||||
|
||||
add_runscript
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue