diff --git a/sftp_transfer b/sftp_transfer index f15a66d..180723c 100644 --- a/sftp_transfer +++ b/sftp_transfer @@ -1,6 +1,7 @@ #!/bin/bash # wget https://git.technozone.com.au/vijay/Scripts/raw/branch/main/sftp_transfer -O sftp_transfer.sh && chmod +x sftp_transfer.sh && ./sftp_transfer.sh && rm sftp_transfer.sh + # Function to display the menu show_menu() { echo "==============================" @@ -25,15 +26,29 @@ zip_folder() { fi } +# Function to list available zip files +list_zip_files() { + echo "Available zip files:" + ls *.zip 2>/dev/null +} + # Function to transfer the zipped file to a remote server transfer_file() { read -p "Enter the remote server username: " username read -p "Enter the remote server address: " server_address read -p "Enter the remote directory to upload the file: " remote_dir + read -sp "Enter the password for the remote server: " password + echo + + # List available zip files + list_zip_files + + # Prompt user to select a zip file read -p "Enter the name of the zipped file to transfer (with .zip): " zip_name if [ -f "$zip_name" ]; then - sftp "${username}@${server_address}" <