MT#62763 Fix shellcheck issues

Warned-by: shellcheck
Change-Id: I86da18b3f87620b67bd70aa6e0cfe744816c650a
master
Guillem Jover 3 weeks ago
parent ba26dc70eb
commit 3c87cea516

@ -0,0 +1,3 @@
external-sources=true
# Used for jdg-tap integration.
source-path=source

@ -26,6 +26,7 @@ else
printf "Error: %s/main could not be read. Exiting.\n" "${FUNCTIONS}" >&2
exit 1
fi
# shellcheck source=./functions/main
. "${FUNCTIONS}/main"
fi
@ -51,6 +52,7 @@ cd "$target_directory"
if ! [ -e "$target_directory"/.ngcpcfg_perms ]; then
log_warn "Permission file ${target_directory}/.ngcpcfg_perms doesn't exist."
else
# shellcheck disable=SC1091
. "${target_directory}"/.ngcpcfg_perms
fi

@ -141,7 +141,7 @@ if [[ "${1:-}" == "decrypt" ]] ; then
fi
}
else
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
fi

@ -16,7 +16,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# based on check_local_state() from scripts/status

@ -16,7 +16,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
MODIFIED_ONLY=false

@ -32,7 +32,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
CONFIG_TYPES=(config maintenance sites network constants)

@ -16,7 +16,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
usage() {

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
cd "${NGCPCTL_MAIN}"

@ -19,7 +19,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
fi
timestamp_replacementchars=''
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# main script
@ -95,9 +95,11 @@ if [ -z "${NO_DB_SYNC:-}" ] ; then
ngcp-sync-db-grants | sed "s/^/$timestamp_replacementchars/"
ngcp-sync-db-creds | sed "s/^/$timestamp_replacementchars/"
if [ -z "${NGCP_TYPE:-}" ] ; then # SPCE
# shellcheck disable=SC1091
. /etc/default/ngcp-roles
fi
if [ "${NGCP_TYPE}" == "carrier" ] && [ "${NGCP_IS_PROXY}" == "yes" ] ; then
# shellcheck disable=SC1091
. /etc/default/ngcp-db
log_info "Synchronizing MariaDB grants/credentials for ${LOCAL_DBHOST}:${LOCAL_DBPORT}"
ngcp-sync-db-grants --db-host "${LOCAL_DBHOST}" --db-port "${LOCAL_DBPORT}" --no-warnings | sed "s/^/$timestamp_replacementchars/"

@ -24,8 +24,9 @@ fi
# source the ${FUNCTIONS}/logs file instead.
timestamp_replacementchars='' # unset by default
# shellcheck disable=SC1090
# shellcheck source=./functions/logs
. "${FUNCTIONS}"/logs
# shellcheck source=./functions/openpgp
. "${FUNCTIONS}"/openpgp
setup_shared_config() {

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
## functions {{{

@ -17,7 +17,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
fi
timestamp_replacementchars=''
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# main script

@ -14,7 +14,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
if [ -z "${EDITOR:-}" ] ; then

@ -18,8 +18,9 @@ if ! [ -r "${FUNCTIONS}"/openpgp ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# shellcheck source=./functions/openpgp
. "${FUNCTIONS}"/openpgp
get_config_file_list() {

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
fi
timestamp_replacementchars=''
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# main script

@ -41,7 +41,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# Get the list of configs in proper order to load.

@ -14,7 +14,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# main script

@ -14,7 +14,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
cd "$NGCPCTL_MAIN"

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
cd "${NGCPCTL_MAIN}"

@ -22,7 +22,7 @@ if [[ ! -r "${FUNCTIONS}"/main ]]; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# functions
@ -146,8 +146,8 @@ systemd_daemon_reload_preset() {
systemctl daemon-reload 2>&1 || true
log_debug "Removing any broken systemd service symlink"
find -L /etc/systemd/system -type l \
| xargs -r rm
find -L /etc/systemd/system -type l -print0 \
| xargs -0 -r rm
log_debug "systemd needs preset-all to enable/disable services (to start them on boot)"
log_debug "Running: rm -rf /etc/systemd/system/*.wants/ || true"

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
## functions {{{

@ -14,7 +14,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
exit 1
fi
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
if [ "$*" = "" ] ; then

@ -15,7 +15,7 @@ if ! [ -r "${FUNCTIONS}"/main ] ; then
fi
timestamp_replacementchars=''
# shellcheck disable=SC1090
# shellcheck source=./functions/main
. "${FUNCTIONS}"/main
# main script

@ -1,6 +1,6 @@
#!/bin/bash
[[ $# -ne 1 ]] && exit 1
# shellcheck source=ngcpcfg.cfg
# shellcheck source=./t/fixtures/ngcpcfg.cfg
source "${1}"
echo "[ngcpcfg]"
# directory name where ngcpcfg is managed through git

@ -22,7 +22,7 @@ bailout() {
rm -f "$OUTPUT"
}
trap bailout 1 2 3 3 6 9 14 15
trap bailout 1 2 3 3 6 14 15
OK() {
printf "ok %s %s\n" "$1" "$2"

Loading…
Cancel
Save