Skip to content

Commit

Permalink
fix shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 30, 2023
1 parent 7e590bb commit 750bf43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions files/ipa-backup-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
#
# Script to work around the fact that ipa-backup always adds timestamps to the
# Script to work around the fact that ipa-backup always adds timestamps to the
# backups. This is not intended to be used standalone, but from Puppet-managed
# cronjobs.
#
# NOTE: this script will destroy old timestamped backup directories if timestamp
# NOTE: this script will destroy old timestamped backup directories if timestamp
# is set to false.

TYPE=$1
Expand All @@ -24,7 +24,7 @@ else
fi

if [ "$TIMESTAMP" = "true" ]; then
# ipa-backup outputs only to stderr so we can't simply redirect to /dev/null
# ipa-backup outputs only to stderr so we can't simply redirect to /dev/null
# and expect cron to email us about errors.
$BACKUP_COMMAND 2> /dev/null || echo "ERROR: $BACKUP_COMMAND failed!"

Expand All @@ -36,7 +36,7 @@ elif [ "$TIMESTAMP" = "false" ]; then
$BACKUP_COMMAND 2> /dev/null || echo "ERROR: $BACKUP_COMMAND failed!"

# Get rid of the timestamp
find $BASEDIR -mindepth 1 -maxdepth 1 -type d -name "ipa-${TYPE}*" -exec mv {} $BASEDIR/ipa-$TYPE \;
find "$BASEDIR" -mindepth 1 -maxdepth 1 -type d -name "ipa-${TYPE}*" -exec mv {} "${BASEDIR}/ipa-${TYPE}" \;
else
echo "ERROR: $TIMESTAMP is not valid value for timestamp!"
exit 1
Expand Down

0 comments on commit 750bf43

Please sign in to comment.