From 9896c3ac1716bb01a188ac13207b3689c2eec234 Mon Sep 17 00:00:00 2001 From: vijay Date: Thu, 8 May 2025 01:52:34 +0000 Subject: [PATCH] Delete sftp_transfer --- sftp_transfer | 81 --------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 sftp_transfer diff --git a/sftp_transfer b/sftp_transfer deleted file mode 100644 index 180723c..0000000 --- a/sftp_transfer +++ /dev/null @@ -1,81 +0,0 @@ -#!/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 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 - # Use sshpass to provide the password for SFTP - sshpass -p "$password" sftp -v "${username}@${server_address}" <