-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09c510b
commit 3672b57
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,6 +195,7 @@ usbutils | |
vim | ||
virtualbox-guest-utils-nox | ||
vpnc | ||
wget | ||
wireless-regdb | ||
wireless_tools | ||
wpa_supplicant | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
|
||
|