From e1f3f7a657904947b2f60543b7dd3bcd1d69fb19 Mon Sep 17 00:00:00 2001 From: nephros Date: Thu, 28 Mar 2024 19:24:56 +0100 Subject: [PATCH 1/2] Escape backticks The commands between them are actually evaluated, leading to lots of confusing help output in the log file. --- bin/harbour-storeman-installer | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/harbour-storeman-installer b/bin/harbour-storeman-installer index b4ebe71..307ab9f 100644 --- a/bin/harbour-storeman-installer +++ b/bin/harbour-storeman-installer @@ -72,11 +72,11 @@ source /etc/os-release; logentry="[Debug] From /etc/os-release: $ID $VERSION_ID printf '\n%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 7 printf '%s' "$logentry" -ssus="$(ssu s | grep -iv 'UID:\? ')"; logentry='[Debug] `ssu status`, UID omitted:' +ssus="$(ssu s | grep -iv 'UID:\? ')"; logentry='[Debug] \`ssu status\`, UID omitted:' printf '\n%s\n%s\n' "$(date -Iseconds) $logentry" "$ssus" systemd-cat -t "$called" -p 7 printf '%s %s' "$logentry" "$(printf '%s' "$ssus" | sed 's/$/, /g' | tr -d '\n')" -ssulr="$(ssu lr | fgrep storeman | tr -s ' ')"; logentry='[Debug] "storeman" entries from `ssu lr`:' +ssulr="$(ssu lr | fgrep storeman | tr -s ' ')"; logentry='[Debug] "storeman" entries from \`ssu lr\`:' printf '\n%s\n%s\n' "$(date -Iseconds) $logentry" "$ssulr" systemd-cat -t "$called" -p 7 printf '%s%s' "$logentry" "$(printf '%s' "$ssulr" | sed -e 's/^ - / /g' -e 's/ ... / /g' | tr '\n' ',')" # Second string starts with a space due to substitution by `sed` @@ -143,7 +143,7 @@ do logentry="[Warning] Failed to refresh harbour-storeman-obs repository, because error-code $retc was returned by: $logentry" printf '\n%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 4 printf '%s' "$logentry" - logentry="[Notice] Trying to terminate (i.e., sending SIGTERM to) all processes named (ID) `pkcon`, then sleeping for $wait seconds." + logentry="[Notice] Trying to terminate (i.e., sending SIGTERM to) all processes named (ID) \`pkcon\`, then sleeping for $wait seconds." printf '%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 5 printf '%s' "$logentry" killall -q -TERM pkcon @@ -156,7 +156,7 @@ do logentry="[Error] Failed to refresh harbour-storeman-obs repository, because error-code $retc was returned by: $logentry" printf '\n%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 3 printf '%s' "$logentry" - logentry="[Warning] Trying to interrupt (i.e., sending SIGINT to) all processes named (ID) `pkcon`, then sleeping for $wait seconds." + logentry="[Warning] Trying to interrupt (i.e., sending SIGINT to) all processes named (ID) \`pkcon\`, then sleeping for $wait seconds." printf '%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 4 printf '%s' "$logentry" killall -q -INT pkcon @@ -170,7 +170,7 @@ do logentry="[Error] Failed to refresh harbour-storeman-obs repository, because error-code $retc was returned by: $logentry" printf '\n%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 3 printf '%s' "$logentry" - logentry="[Warning] Trying to hang-up (i.e., sending SIGHUP to) all processes named (ID) `pkcon`, then sleeping for $i seconds and ultimately killing them." + logentry="[Warning] Trying to hang-up (i.e., sending SIGHUP to) all processes named (ID) \`pkcon\`, then sleeping for $i seconds and ultimately killing them." printf '%s\n' "$(date -Iseconds) $logentry" systemd-cat -t "$called" -p 4 printf '%s' "$logentry" killall -q -HUP pkcon From d535034206cc932da48fa65af6040055e171b0bb Mon Sep 17 00:00:00 2001 From: nephros Date: Thu, 28 Mar 2024 19:35:22 +0100 Subject: [PATCH 2/2] Revert change on one line --- bin/harbour-storeman-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/harbour-storeman-installer b/bin/harbour-storeman-installer index 307ab9f..264abd1 100644 --- a/bin/harbour-storeman-installer +++ b/bin/harbour-storeman-installer @@ -76,7 +76,7 @@ ssus="$(ssu s | grep -iv 'UID:\? ')"; logentry='[Debug] \`ssu status\`, UID omit printf '\n%s\n%s\n' "$(date -Iseconds) $logentry" "$ssus" systemd-cat -t "$called" -p 7 printf '%s %s' "$logentry" "$(printf '%s' "$ssus" | sed 's/$/, /g' | tr -d '\n')" -ssulr="$(ssu lr | fgrep storeman | tr -s ' ')"; logentry='[Debug] "storeman" entries from \`ssu lr\`:' +ssulr="$(ssu lr | fgrep storeman | tr -s ' ')"; logentry='[Debug] "storeman" entries from `ssu lr`:' printf '\n%s\n%s\n' "$(date -Iseconds) $logentry" "$ssulr" systemd-cat -t "$called" -p 7 printf '%s%s' "$logentry" "$(printf '%s' "$ssulr" | sed -e 's/^ - / /g' -e 's/ ... / /g' | tr '\n' ',')" # Second string starts with a space due to substitution by `sed`