Skip to content

Commit

Permalink
Update backupmon.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorJp authored Jul 20, 2024
1 parent a8c6810 commit bba40c1
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions backupmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ vconfig () {
read -p 'Email on Backup Failures? (No=0, Yes=1): ' AMTMEMAILFAILURE1
if [ "$AMTMEMAILFAILURE1" == "" ] || [ -z "$AMTMEMAILFAILURE1" ]; then AMTMEMAILFAILURE=0; else AMTMEMAILFAILURE="$AMTMEMAILFAILURE1"; fi # Using default value on enter keypress
echo ""

#Install @Martinski's shared email library
echo -e "${CClear}Installing Shared Email Library Components..."
cemailQuietArg="-verbose"
Expand All @@ -1166,7 +1166,7 @@ vconfig () {
fi
_CheckForCustomEmailLibraryScript_ "$cemailCheckArg" "$cemailQuietArg"
echo ""

echo -e "Would you like to send a TEST email from BACKUPMON?"
if promptyn "(y/n): "; then

Expand Down Expand Up @@ -5718,13 +5718,6 @@ 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

#echo $PASSWORD | base64 -d > /dev/null 2>&1
echo "$BTPASSWORD" | openssl enc -d -base64 -A | grep -vqE '[^[:graph:]]'
PRI="$?"
Expand Down Expand Up @@ -5842,7 +5835,7 @@ if [ $AMTMEMAIL -eq 1 ]; then
fi
_CheckForCustomEmailLibraryScript_ "$cemailCheckArg" "$cemailQuietArg"
fi

}

# -------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -5989,23 +5982,23 @@ fi
# Check to see if the setup option is being called
if [ "$1" == "-setup" ]
then
# Determine if the config is local or under /jffs/addons/backupmon.d
if [ -f $CFGPATH ]; then #Making sure file exists before proceeding
source $CFGPATH
elif [ -f /jffs/scripts/backupmon.cfg ]; then
source /jffs/scripts/backupmon.cfg
cp /jffs/scripts/backupmon.cfg /jffs/addons/backupmon.d/backupmon.cfg
else
clear
echo -e "${CRed}WARNING: BACKUPMON is not configured. Proceding with 1st time setup!"
echo -e "$(date +'%b %d %Y %X') $(nvram get lan_hostname) BACKUPMON[$$] - WARNING: BACKUPMON is not configured. Proceding with 1st time setup!" >> $LOGFILE
sleep 3
vconfig
fi
checklibupdate
updatecheck

# Determine if the config is local or under /jffs/addons/backupmon.d
if [ -f $CFGPATH ]; then #Making sure file exists before proceeding
source $CFGPATH
elif [ -f /jffs/scripts/backupmon.cfg ]; then
source /jffs/scripts/backupmon.cfg
cp /jffs/scripts/backupmon.cfg /jffs/addons/backupmon.d/backupmon.cfg
else
clear
echo -e "${CRed}WARNING: BACKUPMON is not configured. Proceding with 1st time setup!"
echo -e "$(date +'%b %d %Y %X') $(nvram get lan_hostname) BACKUPMON[$$] - WARNING: BACKUPMON is not configured. Proceding with 1st time setup!" >> $LOGFILE
sleep 3
vconfig
fi

checklibupdate
updatecheck
logoNM
vsetup
fi
Expand Down

0 comments on commit bba40c1

Please sign in to comment.