Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emergency Fix BACKUPMON v1.8.17 #51

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions backupmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ vconfig () {
elif [ "$FREQUENCY" == "P" ]; then
printf "Perpetual"; printf "%s\n"; fi
if [ "$FREQUENCY" == "P" ]; then
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- Purge Backups? : ${CGreen}"
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- Purge Backups : ${CGreen}"
if [ "$PURGE" == "0" ]; then
printf "No"; printf "%s\n";
elif [ "$PURGE" == "1" ]; then
Expand All @@ -494,13 +494,13 @@ vconfig () {
printf $PURGELIMIT; printf "%s\n";
fi
else
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- Purge Backups? : ${CDkGray}No"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- Purge Backups : ${CDkGray}No"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- Purge older than (days) : ${CDkGray}N/A"
fi

echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(12)${CClear} : Backup/Restore Mode : ${CGreen}$MODE"

echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(13)${CClear} : Schedule Backups? : ${CGreen}"
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(13)${CClear} : Schedule Backups : ${CGreen}"
if [ "$SCHEDULE" == "0" ]; then
printf "No"; printf "%s\n";
else printf "Yes"; printf "%s\n"; fi
Expand All @@ -522,19 +522,19 @@ vconfig () {
printf "Backup + Autopurge"; printf "%s\n"; fi
fi

echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(14)${CClear} : AMTM Email Notifications? : ${CGreen}"
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(14)${CClear} : AMTM Email Notifications : ${CGreen}"
if [ "$AMTMEMAIL" == "0" ]; then
printf "No"; printf "%s\n";
else printf "Yes"; printf "%s\n"; fi
if [ "$AMTMEMAILSUCCESS" == "1" ]; then
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- On Success? : ${CGreen}Yes"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- On Success : ${CGreen}Yes"
else
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- On Success? : ${CDkGray}No"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- On Success : ${CDkGray}No"
fi
if [ "$AMTMEMAILFAILURE" == "1" ]; then
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- On Failure? : ${CGreen}Yes"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- On Failure : ${CGreen}Yes"
else
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} | ${CClear}${CDkGray}-- On Failure? : ${CDkGray}No"
echo -e "${InvGreen} ${CClear} ${InvDkGray}${CWhite} | ${CClear}${CDkGray}-- On Failure : ${CDkGray}No"
fi

echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite}(15)${CClear} : Secondary Backup Config Options : ${CGreen}"
Expand Down Expand Up @@ -1271,12 +1271,12 @@ vconfig () {
else SECONDARYFREQUENCY="M";
printf "Monthly"; printf "%s\n"; fi
if [ "$SECONDARYFREQUENCY" == "P" ]; then
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- Purge Secondary Backups? : ${CGreen}"
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}-- Purge Secondary Backups : ${CGreen}"
if [ "$SECONDARYPURGE" == "0" ]; then
printf "No"; printf "%s\n";
else printf "Yes"; printf "%s\n"; fi
else
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- Purge Secondary Backups? : ${CDkGray}"
echo -en "${InvGreen} ${CClear} ${InvDkGray}${CWhite} |--${CClear}${CDkGray}-- Purge Secondary Backups : ${CDkGray}"
if [ "$SECONDARYPURGE" == "0" ]; then
printf "No"; printf "%s\n";
else printf "Yes"; printf "%s\n"; fi
Expand Down Expand Up @@ -1483,7 +1483,7 @@ vconfig () {

#Create a new config file with default values to get it to a basic running state
{ echo 'BTUSERNAME="admin"'
echo 'BTPASSWORD="admin"'
echo 'BTPASSWORD="YWRtaW4K"'
echo 'UNC="\\\\192.168.50.25\\Backups"'
echo 'NFSMOUNTOPT=""'
echo 'UNCDRIVE="/tmp/mnt/backups"'
Expand All @@ -1507,7 +1507,7 @@ vconfig () {
echo 'AMTMEMAILFAILURE=0'
echo 'SECONDARYSTATUS=0'
echo 'SECONDARYUSER="admin"'
echo 'SECONDARYPWD="admin"'
echo 'SECONDARYPWD="YWRtaW4K"'
echo 'SECONDARYUNC="\\\\192.168.50.25\\SecondaryBackups"'
echo 'SECONDARYNFSMOUNTOPT=""'
echo 'SECONDARYUNCDRIVE="/tmp/mnt/secondarybackups"'
Expand Down Expand Up @@ -3543,11 +3543,11 @@ vsetup () {
fi

#Check to see if old conflicting variable names are being used
if [ ! -z "$USERNAME" ]; then
sed -i "s/USERNAME=/BTUSERNAME=/" "/jffs/addons/backupmon.d/backupmon.cfg"
sed -i "s/PASSWORD=/BTPASSWORD=/" "/jffs/addons/backupmon.d/backupmon.cfg"
source $CFGPATH
fi
#if [ ! -z "$USERNAME" ]; then
# sed -i "s/USERNAME=/BTUSERNAME=/" "/jffs/addons/backupmon.d/backupmon.cfg"
# sed -i "s/PASSWORD=/BTPASSWORD=/" "/jffs/addons/backupmon.d/backupmon.cfg"
# source $CFGPATH
#fi

tzone=$(date +%Z)
tzonechars=$(echo ${#tzone})
Expand Down Expand Up @@ -5738,11 +5738,11 @@ unmounttestdrv () {
checkplaintxtpwds () {

#Check to see if old conflicting variable names are being used
if [ ! -z "$USERNAME" ]; then
sed -i "s/USERNAME=/BTUSERNAME=/" "/jffs/addons/backupmon.d/backupmon.cfg"
sed -i "s/PASSWORD=/BTPASSWORD=/" "/jffs/addons/backupmon.d/backupmon.cfg"
source $CFGPATH
fi
#if [ ! -z "$USERNAME" ]; then
# sed -i "s/USERNAME=/BTUSERNAME=/" "/jffs/addons/backupmon.d/backupmon.cfg"
# sed -i "s/PASSWORD=/BTPASSWORD=/" "/jffs/addons/backupmon.d/backupmon.cfg"
# source $CFGPATH
#fi

#echo $PASSWORD | base64 -d > /dev/null 2>&1
echo "$BTPASSWORD" | openssl enc -d -base64 -A | grep -vqE '[^[:graph:]]'
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
v1.8.17 - (July 18, 2024)
- PATCH: With many thanks to @Martinski, he helped develop a new methodology to build in more
redudancy should we ever face another situation like this again, where the shared email libary
redundancy should we ever face another situation like this again, where the shared email library
file location becomes unavailable. In this latest mod, he has built in the capability of using
three distinct file location URLs that the script will use to find and download the latest
version. HUGE THANK YOU for supporting this, @Martinski! :)
Expand Down