From 589fd1a90bb39b090bde4deb48fc1baaef108bbf Mon Sep 17 00:00:00 2001 From: NEOLabs Software <101670923+NEOLabs-software@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:44:34 +0000 Subject: [PATCH] fix script yet again --- scripts/mega.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/mega.sh b/scripts/mega.sh index dad8115..5660a1e 100644 --- a/scripts/mega.sh +++ b/scripts/mega.sh @@ -1,14 +1,16 @@ #!/bin/bash +# sudo bash -c "apt update ; apt install wget ; wget https://mega.nz/linux/repo/xUbuntu_22.04/amd64/megacmd-xUbuntu_22.04_amd64.deb ; apt install ./*deb" + # Replace these with your actual MEGA account credentials -EMAIL="$4" -PASSWORD="$3" +EMAIL=$1 +PASSWORD=$2 # Specify the local file or folder to upload -LOCAL_PATH="$1" +LOCAL_PATH="$4" # Specify the remote folder to upload to -REMOTE_PATH="$2" +REMOTE_PATH="$3" # Log in to MEGA echo "Logging into MEGA..." @@ -19,7 +21,8 @@ if [ $? -ne 0 ]; then echo "Login failed. Exiting." exit 1 fi -# apt update ; apt install wget ; wget https://mega.nz/linux/repo/xUbuntu_22.04/amd64/megacmd-xUbuntu_22.04_amd64.deb ; apt install ./*deb + + # remove file from mega echo "Removing "$REMOTE_PATH$LOCAL_PATH @@ -32,6 +35,7 @@ mega-put "$LOCAL_PATH" "$REMOTE_PATH" # Check if upload was successful if [ $? -ne 0 ]; then echo "Upload failed. Exiting." + mega-logout exit 1 fi