From 1547f8b0c94879e485a1f7ee5920469cd87fcfb9 Mon Sep 17 00:00:00 2001 From: Marvin Arnold Date: Fri, 22 Oct 2021 13:43:40 -0500 Subject: [PATCH] fix: shellcheck and linting --- Dockerfile | 2 ++ reset_lgw.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a7ed64..aa17285 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,9 +53,11 @@ COPY pktfwd/ "$PYTHON_APP_DIR" COPY reset_lgw.sh "$RESET_LGW_FILEPATH" # Copy sx1301 lora_pkt_fwd_SPI_BUS +# hadolint ignore=DL3022 COPY --from=nebraltd/packet_forwarder:4ae10d80892174ba8598cf98fbefd52721a2d59b "$SX1301_PACKET_FORWARDER_OUTPUT_DIR" "$SX1301_DIR" # Copy sx1302 chip_id, reset_lgw, and lora_pkt_fwd +# hadolint ignore=DL3022 COPY --from=nebraltd/sx1302_hal:e8533b93e76c5a04075de8905ba0c7e93434776c "$SX1302_HAL_OUTPUT_DIR" "$SX1302_DIR" # Copy pktfwd python app dependencies diff --git a/reset_lgw.sh b/reset_lgw.sh index 7106210..fcd3bf3 100755 --- a/reset_lgw.sh +++ b/reset_lgw.sh @@ -2,7 +2,7 @@ # This script is intended to be used on all sx130x platforms. It performs # the following actions: -# - export/unpexort GPIO pin $CONCENTRATOR_RESET_PIN used to reset the SX130x chip and to enable the LDOs +# - export/unpexort GPIO pin ${CONCENTRATOR_RESET_PIN} used to reset the SX130x chip and to enable the LDOs # - can also be used to reset other functions like the optional SX1261 radio used for LBT/Spectral Scan, SX1302 power enable, # or AD5338R reset, by changing the value of CONCENTRATOR_RESET_PIN # @@ -30,24 +30,24 @@ WAIT_GPIO() { init() { # setup GPIOs - echo "$CONCENTRATOR_RESET_PIN" > /sys/class/gpio/export; WAIT_GPIO + echo "${CONCENTRATOR_RESET_PIN}" > /sys/class/gpio/export; WAIT_GPIO # set GPIOs as output - echo "out" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/direction; WAIT_GPIO + echo "out" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/direction"; WAIT_GPIO } reset() { - echo "CoreCell reset through GPIO$CONCENTRATOR_RESET_PIN..." + echo "CoreCell reset through GPIO${CONCENTRATOR_RESET_PIN}..." - echo "1" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/value; WAIT_GPIO - echo "0" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/value; WAIT_GPIO + echo "1" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/value"; WAIT_GPIO + echo "0" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/value"; WAIT_GPIO } term() { # cleanup all GPIOs - if [ -d /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN ] + if [ -d "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}" ] then - echo "$CONCENTRATOR_RESET_PIN" > /sys/class/gpio/unexport; WAIT_GPIO + echo "${CONCENTRATOR_RESET_PIN}" > /sys/class/gpio/unexport; WAIT_GPIO fi }