Skip to content

Commit

Permalink
Ensure the entrypoint script does not fail on directories existing bu…
Browse files Browse the repository at this point in the history
…t not containing any .sh files
  • Loading branch information
zipkid committed Oct 23, 2024
1 parent aa8c1ac commit 857982e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions puppetserver/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ pre_execution_handler() {
-exec chmod +x {} \;
sync
for f in /docker-custom-entrypoint.d/*.sh; do
echo "Running $f"
"$f"
if [[ -f "$f" && -x $(realpath "$f") ]]; then
echo "Running $f"
"$f"
fi
done
fi
}
Expand All @@ -42,8 +44,10 @@ post_startup_handler() {
-exec chmod +x {} \;
sync
for f in /docker-custom-entrypoint.d/post-startup/*.sh; do
echo "Running $f"
"$f"
if [[ -f "$f" && -x $(realpath "$f") ]]; then
echo "Running $f"
"$f"
fi
done
fi
fi
Expand All @@ -57,8 +61,10 @@ post_execution_handler() {
-exec chmod +x {} \;
sync
for f in /docker-custom-entrypoint.d/post-execution/*.sh; do
echo "Running $f"
"$f"
if [[ -f "$f" && -x $(realpath "$f") ]]; then
echo "Running $f"
"$f"
fi
done
fi
fi
Expand All @@ -79,8 +85,10 @@ sigterm_handler() {
-exec chmod +x {} \;
sync
for f in /docker-custom-entrypoint.d/sigterm-handler/*.sh; do
echo "Running $f"
"$f"
if [[ -f "$f" && -x $(realpath "$f") ]]; then
echo "Running $f"
"$f"
fi
done
fi
fi
Expand Down

0 comments on commit 857982e

Please sign in to comment.