mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
FTP: fixed port, paths and messages
This commit is contained in:
parent
805c0e62dc
commit
76ad3ac23c
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
port=7777
|
port=21
|
||||||
|
ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
# Check if the port is in use
|
# Check if the port is in use
|
||||||
if nc -z localhost $port; then
|
if nc -z localhost $port; then
|
||||||
|
@ -12,7 +13,7 @@ if nc -z localhost $port; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start FTP server on port $port
|
# 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
|
# Get the PID of the FTP server process
|
||||||
ftp_pid=$!
|
ftp_pid=$!
|
||||||
|
@ -27,7 +28,7 @@ stop_ftp_server() {
|
||||||
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
|
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK - FTP Server" \
|
--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
|
# If the user clicks "Stop", call the function to stop the FTP server
|
||||||
stop_ftp_server
|
stop_ftp_server
|
||||||
|
|
|
@ -723,9 +723,9 @@ prepare_emulator() {
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
|
|
||||||
mkdir -p "/var/config/ftp"
|
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
|
# 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
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue