Skip to content

Commit

Permalink
Fixes for shellcheck
Browse files Browse the repository at this point in the history
The difference between @ and * in the bash arrays:
```
(d) cbast1.lon5:~> set -x; echo "${nick[@]}"; set +x
+ set -x
+ echo

+ set +x
(d) cbast1.lon5:~> set -x; echo "${nick[*]}"; set +x
+ echo ''

+ set +x
(d) cbast1.lon5:~>
```
  • Loading branch information
rhodesn committed Mar 19, 2018
1 parent 7332900 commit 381dbc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions auter.aptModule
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ function prepare_updates() {
DOWNLOADLOGMSG=" to ${DOWNLOADDIR}/${CONFIGSET}"
fi
declare -x DEBIAN_FRONTEND=noninteractive
PREPOUTPUT=$($PACKAGE_MANAGER $PACKAGEMANAGEROPTIONS $DOWNLOADOPTION --download-only dist-upgrade -y 2>&1)
PREPOUTPUT=$("${PACKAGE_MANAGER}" "${PACKAGEMANAGEROPTIONS[@]}" "${DOWNLOADOPTION}" --download-only dist-upgrade -y 2>&1)
if [[ $(echo "${PREPOUTPUT}" | grep -c '^[WE]:') -gt 0 ]]; then
logit "ERROR: There were errors returned by \`${PACKAGE_MANAGER} ${PACKAGEMANAGEROPTIONS[@]} ${DOWNLOADOPTION} --download-only dist-upgrade -y\`. Exiting."
logit "ERROR: There were errors returned by \`${PACKAGE_MANAGER} ${PACKAGEMANAGEROPTIONS[*]} ${DOWNLOADOPTION} --download-only dist-upgrade -y\`. Exiting."
else
logit "INFO: Updates downloaded${DOWNLOADLOGMSG}"
fi
else [[ "${AVAILABLE_PACKAGE_COUNT}" -eq 0 ]]
logit "INFO: No updates are available to be downloaded."
fi
else
logit "ERROR: There were errors returned by \`${PACKAGE_MANAGER} -u upgrade --assume-no ${PACKAGEMANAGEROPTIONS[@]}\`. Exiting."
logit "ERROR: There were errors returned by \`${PACKAGE_MANAGER} -u upgrade --assume-no ${PACKAGEMANAGEROPTIONS[*]}\`. Exiting."
fi
else
logit "WARNING: downloadonly option is not available"
Expand Down Expand Up @@ -130,7 +130,7 @@ function apply_updates() {
log_last_run
fi
else
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} -u upgrade --assume-no ${PACKAGEMANAGEROPTIONS[@]}\`. Exiting."
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} -u upgrade --assume-no ${PACKAGEMANAGEROPTIONS[*]}\`. Exiting."
quit 3
fi
}
4 changes: 2 additions & 2 deletions auter.yumdnfModule
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function prepare_updates() {
fi

elif [[ "${RC}" -eq 1 ]]; then
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} ${PACKAGEMANAGEROPTIONS[@]} ${DOWNLOADOPTION[@]} update --downloadonly -y\`. Exiting."
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} ${PACKAGEMANAGEROPTIONS[*]} ${DOWNLOADOPTION[*]} update --downloadonly -y\`. Exiting."
else
logit "INFO: No updates are available to be downloaded."
fi
Expand Down Expand Up @@ -161,7 +161,7 @@ function apply_updates() {
logit "INFO: No updates are available to be applied."
log_last_run
else
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} check-update ${PACKAGEMANAGEROPTIONS[@]}\`. Exiting."
logit "ERROR: Exit status ${RC} returned by \`${PACKAGE_MANAGER} check-update ${PACKAGEMANAGEROPTIONS[*]}\`. Exiting."
quit 3
fi
}

0 comments on commit 381dbc3

Please sign in to comment.