Skip to content

Commit

Permalink
fix: ignore empty lines on cron lines
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod committed Nov 13, 2023
1 parent e7af4c5 commit 933a509
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion maclaunch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function getKernelExtensions {

function getCronjobs {
while IFS= read -r cron; do
if [ -z "$cron" ]; then
continue
fi

if echo "$cron" | cut -d ' ' -f 1 | grep -q '@'; then
# @reboot notation
echo "$cron" | cut -d ' ' -f 2
Expand All @@ -84,7 +88,7 @@ function listCronJobs {
echo -e " Type : cronjob"
echo -e " User : $(whoami)"
echo -e " Launch: ${ORANGE}enabled${NC}"
echo " File : n/a"
echo " File : ${name}"
done
}

Expand Down

0 comments on commit 933a509

Please sign in to comment.