Files
SimpleLinux/scripts/sftp_server.sh
T
2026-03-06 18:01:24 +07:00

43 lines
1.2 KiB
Bash

#!/bin/bash
. ./scripts/colors.sh
. ./scripts/funcs.sh
. ./scripts/config.sh
. ./scripts/dropbear.sh
sftp_server() {
if [ ! -d $build/zlib ]; then
zlib
fi
if [ ! -d $build/dropbear ]; then
dropbear
fi
print_info "** Building sftp-server"
srcurl=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz
_archive=openssh-9.9p1.tar.gz
[ -d $build/sftp_server ] && return 0
mkdir -p $build/sftp_server
cd $build/sftp_server
if [ ! -f $root/downloads/${_archive} ]; then
print_info "** Downloading $srcurl"
cd $root/downloads
wget $srcurl
check $? "download $srcurl"
cd -
fi
tar -xf $root/downloads/openssh-9.9p1.tar.gz
check $? "Extract openssh"
cd openssh-9.9p1
./configure \
--prefix=/usr \
--host=$CROSS_COMPILE \
--without-openssl \
--with-zlib=$rootfspath/usr/include
check $? "Configure openssh"
make sftp-server $makeflags
check $? "Build sftp-server"
cp -v sftp-server $rootfspath/usr/bin/
check $? "Install sftp-server to rootfs directory"
check $? "Build and install sftp-server to rootfs directory"
}