Skip to content

Commit

Permalink
add mega script
Browse files Browse the repository at this point in the history
  • Loading branch information
NEOLabs-software committed Nov 6, 2024
1 parent 09c510b commit 3672b57
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions eiso/packages.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ usbutils
vim
virtualbox-guest-utils-nox
vpnc
wget
wireless-regdb
wireless_tools
wpa_supplicant
Expand Down
50 changes: 50 additions & 0 deletions scripts/mega.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# Replace these with your actual MEGA account credentials
EMAIL="thayeeboi890@gmail.com"
PASSWORD="$3"

# Specify the local file or folder to upload
LOCAL_PATH="$1"

# Specify the remote folder to upload to
REMOTE_PATH="$2"

# Log in to MEGA
echo "Logging into MEGA..."
mega-login $EMAIL $PASSWORD

# Check if login was successful
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
mega-rm "$REMOTE_PATH""$LOCAL_PATH"

# Check if removal was successful
if [ $? -ne 0 ]; then
echo "Removal failed. Exiting."
exit 1
fi

# Upload the file or folder
echo "Uploading $LOCAL_PATH to $REMOTE_PATH..."
mega-put "$LOCAL_PATH" "$REMOTE_PATH"

# Check if upload was successful
if [ $? -ne 0 ]; then
echo "Upload failed. Exiting."
exit 1
fi

# Log out from MEGA
echo "Logging out from MEGA..."
mega-logout

echo "Upload complete."


0 comments on commit 3672b57

Please sign in to comment.