#!/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 "==============================" echo " SFTP Transfer Menu " echo "==============================" echo "1. Zip a folder" echo "2. Transfer zipped file to remote server" echo "3. Exit" echo "==============================" } # Function to zip a folder zip_folder() { read -p "Enter the folder path to zip: " folder_path read -p "Enter the name for the zipped file (without .zip): " zip_name if [ -d "$folder_path" ]; then zip -r "${zip_name}.zip" "$folder_path" echo "Folder zipped successfully as ${zip_name}.zip" else echo "Error: Directory does not exist." fi } # 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 -p "Enter the name of the zipped file to transfer (with .zip): " zip_name if [ -f "$zip_name" ]; then sftp "${username}@${server_address}" <