add set -e, and do some shellcheck cleanup

This commit is contained in:
Fredrik Thulin 2023-02-03 16:05:09 +01:00
parent 25463e6013
commit 708c6c1b64
No known key found for this signature in database
GPG key ID: 198C1AFD505152DD

View file

@ -1,13 +1,15 @@
#!/bin/sh
set -e
if [ "x$COSMOS_VERBOSE" = "xy" ]; then
args="--verbose --show_diff"
else
args="--logdest=syslog"
fi
if [ -f /usr/bin/puppet -a -d /etc/puppet/manifests ]; then
for m in `find /etc/puppet/manifests -name \*.pp`; do
if [ -f /usr/bin/puppet ] && [ -d /etc/puppet/manifests ]; then
find /etc/puppet/manifests -name \*.pp | while read -r m; do
test "x$COSMOS_VERBOSE" = "xy" && echo "$0: Applying Puppet manifest $m"
puppet apply $args $m
done