Skip to content

Commit

Permalink
Wrapped expression in test construct
Browse files Browse the repository at this point in the history
Restart cron on uptime event
  • Loading branch information
nuxy committed Sep 11, 2023
1 parent 5110196 commit a15f6b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ yum -y install docker

if [ "$NET_DEV" = "ens5" ]; then
yum -y install cronie cronie-anacron

systemctl enable crond.service
systemctl start crond.service
fi

service docker start && chkconfig docker on
Expand Down Expand Up @@ -77,7 +80,7 @@ CONTAINER_ID=$CONTAINER_ID
0 0 * * * /bin/docker restart \$CONTAINER_ID > /dev/null
# Keep-alive process.
* * * * * if [ ! \$(pgrep -f Miscreated) ]; then /bin/docker restart \$CONTAINER_ID > /dev/null; fi
* * * * * if [[ ! \$(pgrep -f Miscreated) ]]; then /bin/docker restart \$CONTAINER_ID > /dev/null; fi
EOF

# Restart the instance.
Expand Down

0 comments on commit a15f6b0

Please sign in to comment.