Skip to content

Commit

Permalink
fix: don't return 1 if crontab doesn't exist
Browse files Browse the repository at this point in the history
It still get's created. Fixes #17
  • Loading branch information
rmens committed Jan 25, 2025
1 parent 459bc34 commit 5ca0e59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ fi
if [ "$ENABLE_HEARTBEAT" == "y" ]; then
echo -e "${BLUE}►► Setting up heartbeat monitoring...${NC}"
HEARTBEAT_CRONJOB="* * * * * wget --spider $HEARTBEAT_URL > /dev/null 2>&1"
if ! crontab -l | grep -F -- "$HEARTBEAT_CRONJOB" > /dev/null; then
(crontab -l 2>/dev/null; echo "$HEARTBEAT_CRONJOB") | crontab -
(crontab -l 2>/dev/null || true; echo "$HEARTBEAT_CRONJOB") | crontab -
else
echo -e "${YELLOW}Heartbeat monitoring cronjob already exists. No changes made.${NC}"
fi
Expand Down

0 comments on commit 5ca0e59

Please sign in to comment.