From c467b52cfe5c9fd45a48dbda397ea2226bf88226 Mon Sep 17 00:00:00 2001 From: zerf58 Date: Wed, 18 Jun 2025 09:54:29 -0700 Subject: [PATCH] more shellcheck --- buttons.sh | 10 +++++----- init.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buttons.sh b/buttons.sh index 9eba770..66968bf 100755 --- a/buttons.sh +++ b/buttons.sh @@ -1,19 +1,19 @@ #!/bin/bash ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -export ROOT=ROOT +export ROOT="$ROOT" button="$1" debug(){ - debug=$ROOT/debug + debug="$ROOT"/debug # todo: # this keeps the log file at 30 lines but breaks the pipe when doing "tail -F debug" - tail -n 30 $debug > debug.tmp && mv debug.tmp $debug + tail -n 30 "$debug" > debug.tmp && mv debug.tmp "$debug" echo "$1" - echo "$1">>$debug + echo "$1">>"$debug" } -active=$(bash $ROOT/get_active_window.sh) +active=$(bash "$ROOT"/get_active_window.sh) debug "" debug "$(date +%s)" debug "active: $active" diff --git a/init.sh b/init.sh index c1d0490..1f40279 100755 --- a/init.sh +++ b/init.sh @@ -7,7 +7,7 @@ rm /home/htpc/.kodi/userdata/keymaps/keyboard.xml ln /home/htpc/scripts/PJ/xml/keyboard.xml /home/htpc/.kodi/userdata/keymaps/keyboard.xml rm /home/htpc/.kodi/userdata/advancedsettings.xml -export "$(grep -v '^#' /home/htpc/scripts/PJ/secrets.env | xargs)" +export $(grep -v '^#' /home/htpc/scripts/PJ/secrets.env | xargs) envsubst < /home/htpc/scripts/PJ/xml/advancedsettings.xml > /home/htpc/.kodi/userdata/advancedsettings.xml # disable the power button on PJ, ignore if already commented