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

Some cleanup. #303

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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
36 changes: 0 additions & 36 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ readonly cronJobsRegEx5="[[:blank:]]+${USB_MNT_DIRPATH1}/.* "
readonly cronJobsRegEx6="[[:blank:]]+${USB_MNT_DIRPATH2}/.* "
readonly addonCronJobList="/home/root/addonCronJobList_$$.txt"

##FOR TESTING/DEBUG ONLY##
debugAddOnCronJobsList=false
##Set to 'false' for Production Release ##
[ "$SCRIPT_BRANCH" = "master" ] && debugAddOnCronJobsList=false
readonly restoreAddOnCronJobList="${SETTINGS_DIR}/restoreAddOnCronJobs.sh"
##FOR TESTING/DEBUG ONLY##

##----------------------------------------##
## Modified by Martinski W. [2024-Jun-05] ##
##----------------------------------------##
Expand Down Expand Up @@ -5131,17 +5124,6 @@ _RemoveCronJobsFromAddOns_()
return 1
fi

##FOR TESTING/DEBUG ONLY##
if "$debugAddOnCronJobsList"
then
{
echo "#!/bin/sh"
echo "# Created by ${SCRIPT_NAME} #"
echo "#"
} > "$restoreAddOnCronJobList"
fi
##FOR TESTING/DEBUG ONLY##

local cronJobCount=0 cronJobIDx cronJobCMD

while read -r cronJobLINE
Expand All @@ -5162,29 +5144,11 @@ _RemoveCronJobsFromAddOns_()
else Say "Cron job [$cronJobIDx] was removed successfully."
fi
fi

##FOR TESTING/DEBUG ONLY##
if "$debugAddOnCronJobsList" && [ -n "$cronJobIDx" ]
then
{
printf "cru a $cronJobIDx \"${cronJobCMD}\"\n"
} >> "$restoreAddOnCronJobList"
fi
##FOR TESTING/DEBUG ONLY##

done < "$addonCronJobList"

rm -f "$addonCronJobList"
Say "Cron jobs [$cronJobCount] from 3rd-party add-ons were removed."

##FOR TESTING/DEBUG ONLY##
if "$debugAddOnCronJobsList"
then
echo "#EOF#" >> "$restoreAddOnCronJobList"
chmod 755 "$restoreAddOnCronJobList"
fi
##FOR TESTING/DEBUG ONLY##

sleep 5
return 0
}
Expand Down