From 76ad3ac23cfbbd87c2d9264d029ada6857f8d26c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Nov 2023 14:56:03 +0100 Subject: [PATCH] FTP: fixed port, paths and messages --- functions/ftp_server.sh | 7 ++++--- functions/prepare_emulator.sh | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/functions/ftp_server.sh b/functions/ftp_server.sh index ebbd019e..0b672cbe 100644 --- a/functions/ftp_server.sh +++ b/functions/ftp_server.sh @@ -1,6 +1,7 @@ #!/bin/bash -port=7777 +port=21 +ip=$(hostname -I | awk '{print $1}') # Check if the port is in use if nc -z localhost $port; then @@ -12,7 +13,7 @@ if nc -z localhost $port; then fi # Start FTP server on port $port -nohup vsftpd /var/config/ftp/vsftpd.conf & +nohup vsftpd /var/config/retrodeck/ftp/vsftpd.conf & # Get the PID of the FTP server process ftp_pid=$! @@ -27,7 +28,7 @@ stop_ftp_server() { zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK - FTP Server" \ - --text="FTP server started on port $port, pointing to:\n$rdhome\nID:\tretrodeck\nPassword:\tretrodeck\n\nPress Stop to terminate the server." --ok-label="Stop" || stop_ftp_server + --text="FTP server started.\n\nAddress: $ip\nport: $port\nID:\tretrodeck\nPassword:\tretrodeck\npointing to:\n$rdhome\n\nPress Stop to terminate the server." --ok-label="Stop" || stop_ftp_server # If the user clicks "Stop", call the function to stop the FTP server stop_ftp_server diff --git a/functions/prepare_emulator.sh b/functions/prepare_emulator.sh index dded18c1..b51ca8f8 100644 --- a/functions/prepare_emulator.sh +++ b/functions/prepare_emulator.sh @@ -723,9 +723,9 @@ prepare_emulator() { echo "------------------------" mkdir -p "/var/config/ftp" - cp "/app/retrodeck/ftp/*" "/var/config/ftp" + cp "/app/retrodeck/ftp/*" "/var/config/retrodeck/ftp" # TODO: this step is to be done properly: Replacing RETRODECKHOMEDIR placeholder - sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "/var/config/ftp/vsftpd.conf" + sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "/var/config/retrodeck/ftp/vsftpd.conf" fi