From 8a3d1990182eb307fe67d41fb6a95beef6d2c018 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Nov 2023 09:44:09 +0100 Subject: [PATCH] FTP: fixed configuration and reset logics --- functions/ftp_server.sh | 2 +- functions/prepare_emulator.sh | 8 ++++---- tools/ftp/vsftpd.conf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/ftp_server.sh b/functions/ftp_server.sh index bd61a3ae..ebbd019e 100644 --- a/functions/ftp_server.sh +++ b/functions/ftp_server.sh @@ -12,7 +12,7 @@ if nc -z localhost $port; then fi # Start FTP server on port $port -nohup vsftpd /app/retrodeck/ftp/vsftpd.conf & +nohup vsftpd /var/config/ftp/vsftpd.conf & # Get the PID of the FTP server process ftp_pid=$! diff --git a/functions/prepare_emulator.sh b/functions/prepare_emulator.sh index 5107e26a..dded18c1 100644 --- a/functions/prepare_emulator.sh +++ b/functions/prepare_emulator.sh @@ -714,7 +714,7 @@ prepare_emulator() { fi - # TODO: this is not properly an emulator but le'ts treat like this for the moment + # TODO: this is not properly an emulator but let's treat like this for the moment if [[ "$emulator" =~ ^(ftp|FTP|all)$ ]]; then # TODO: do a proper script # This is just a placeholder script to test the emulator's flow @@ -722,10 +722,10 @@ prepare_emulator() { echo "Initializing FTP Server" echo "------------------------" - mkdir -p /var/config/umftpd - cp /app/tools/ftp/config.json /var/config/umftpd + mkdir -p "/var/config/ftp" + cp "/app/retrodeck/ftp/*" "/var/config/ftp" # TODO: this step is to be done properly: Replacing RETRODECKHOMEDIR placeholder - sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "/var/config/umftpd/config.json" + sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "/var/config/ftp/vsftpd.conf" fi diff --git a/tools/ftp/vsftpd.conf b/tools/ftp/vsftpd.conf index 1427e46b..7c1c48a3 100644 --- a/tools/ftp/vsftpd.conf +++ b/tools/ftp/vsftpd.conf @@ -2,7 +2,7 @@ anonymous_enable=NO virtual_users=YES -userlist_file=/app/retrodeck/ftp/virtual_users.txt +userlist_file=/var/config/ftp/virtual_users.txt userlist_enable=YES userlist_deny=NO write_enable=YES