From 3988f5beb000cb48bc90e775ad5bc6afed60644f Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Mon, 6 Feb 2023 16:41:04 +0100 Subject: [PATCH] shellcheck fixes --- global/overlay/usr/local/bin/run-cosmos | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/global/overlay/usr/local/bin/run-cosmos b/global/overlay/usr/local/bin/run-cosmos index 5f2cbc1..fdfb85d 100755 --- a/global/overlay/usr/local/bin/run-cosmos +++ b/global/overlay/usr/local/bin/run-cosmos @@ -16,29 +16,29 @@ lock() { eval "exec $fd>$lock_file" # acquier the lock - flock -n $fd \ + flock -n "$fd" \ && return 0 \ || return 1 } eexit() { - local error_str="$@" + local error_str="$*" - echo $error_str + echo "$error_str" exit 1 } main () { - lock $PROGNAME || eexit "Only one instance of $PROGNAME can run at one time." - cosmos $* update - cosmos $* apply + lock "$PROGNAME" || eexit "Only one instance of $PROGNAME can run at one time." + cosmos "$@" update + cosmos "$@" apply touch /var/run/last-cosmos-ok.stamp - find /var/lib/puppet/reports/ -type f -mtime +10 | xargs rm -f + find /var/lib/puppet/reports/ -type f -mtime +10 -print0 | xargs -0 rm -f } -main $* +main "$@" if [ -f /cosmos-reboot ]; then rm -f /cosmos-reboot