From 41f5d8738a7ea646775d07b56954c3f28b091fa3 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 24 Jun 2022 23:44:07 +0100 Subject: [PATCH] fix a few shellcheck errors --- src/run.sh | 1 + src/steps-config/50-wesher-wireguard.sh | 2 ++ src/steps-postinstall/10-wesher.sh | 1 + src/steps-postinstall/20-collectd.sh | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/run.sh b/src/run.sh index d2d29b3..c9dd6f2 100755 --- a/src/run.sh +++ b/src/run.sh @@ -164,6 +164,7 @@ step_current="1"; stage_begin "Configuring software choices"; + source ./steps-config/10-hostname.sh; if ask_yesno "Use apt-cacher-ng server?"; then diff --git a/src/steps-config/50-wesher-wireguard.sh b/src/steps-config/50-wesher-wireguard.sh index c5f058f..6931ef2 100755 --- a/src/steps-config/50-wesher-wireguard.sh +++ b/src/steps-config/50-wesher-wireguard.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +#shellcheck disable=SC2034 wesher_secret="$(ask_password "wesher configuration" "Enter the wesher shared secret:")"; +#shellcheck disable=SC2034 wesher_join_ip="$(ask_text "wesher configuration" "Enter an IP of a host in the cluster to join:")"; queue_apt_install "raspberrypi-kernel-headers" "wireguard" "wesher" "wesher-systemd"; diff --git a/src/steps-postinstall/10-wesher.sh b/src/steps-postinstall/10-wesher.sh index e7db2c5..5aba510 100755 --- a/src/steps-postinstall/10-wesher.sh +++ b/src/steps-postinstall/10-wesher.sh @@ -10,6 +10,7 @@ task_end "$?"; task_begin "wesher: joining cluster" # HACK: Ref https://github.com/costela/wesher/issues/70 +#shellcheck disable=SC2154 WESHER_CLUSTER_KEY="${wesher_secret}" wesher /usr/local/sbin/wesher --overlay-net 172.31.250.0/16 --log-level info --join "${wesher_join_ip}" & sleep 5; diff --git a/src/steps-postinstall/20-collectd.sh b/src/steps-postinstall/20-collectd.sh index 33383b4..7bdefa1 100755 --- a/src/steps-postinstall/20-collectd.sh +++ b/src/steps-postinstall/20-collectd.sh @@ -21,7 +21,7 @@ subtask_begin "Installing configuration file"; touch "${collectd_conf_target}"; chmod 0600 "${collectd_conf_target}"; #shellcheck disable=SC2154 -cat configs/collectd.conf | awk -v "user=${collectd_username}" -v "pass=${collectd_password}" '{ gsub("|||USERNAME|||", user); gsub("|||PASSWORD|||", pass); print }' >"${collectd_conf_target}"; +awk -v "user=${collectd_username}" -v "pass=${collectd_password}" '{ gsub("|||USERNAME|||", user); gsub("|||PASSWORD|||", pass); print }' >"${collectd_conf_target}" <"configs/collectd.conf"; subtask-end "$?"; subtask_begin "Starting collectd & enabling on boot";