mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
21 lines
663 B
Bash
21 lines
663 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Function to stop the FTP server
|
||
|
stop_server() {
|
||
|
if [ -n "$SERVER_PID" ]; then
|
||
|
kill $SERVER_PID
|
||
|
pkill -f ftp_server.py
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Start the FTP server
|
||
|
ftp_id="RetroDECK"
|
||
|
ftp_pass="RetroDECK"
|
||
|
ftp_port=6346
|
||
|
rdhome="/home/jay/retrodeck" #DEBUG
|
||
|
python3 /home/jay/gits/RetroDECK/functions/ftp_server.py "$rdhome" "$ftp_port" "$ftp_id" "$ftp_pass" &
|
||
|
SERVER_PID=$(pgrep -f "python3 /home/jay/gits/RetroDECK/functions/ftp_server.py")
|
||
|
|
||
|
# Main menu with only "Stop" button
|
||
|
zenity --info --text="FTP server started, log in with:\n\nID: $ftp_id\nPassword: $ftp_pass\nPort: $ftp_port.\n\nPress 'Stop' when done" --ok-label="Stop"
|
||
|
stop_server
|