From e0b7fb752eeb94cb92e2086d6213971035b1b9fb Mon Sep 17 00:00:00 2001 From: Burnett01 Date: Mon, 1 Sep 2025 16:11:00 +0000 Subject: [PATCH] fix: replace tilde with $HOME for consistent path usage in scripts --- docker-rsync/hosts-add | 2 +- docker-rsync/hosts-clear | 2 +- docker-rsync/hosts-init | 4 ++-- docker-rsync/ssh-init | 2 +- entrypoint.sh | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-rsync/hosts-add b/docker-rsync/hosts-add index 45a3d04..37dde9c 100755 --- a/docker-rsync/hosts-add +++ b/docker-rsync/hosts-add @@ -2,4 +2,4 @@ set -euo pipefail -printf '%s\n' "$@" >> ~/.ssh/known_hosts +printf '%s\n' "$@" >> $HOME/.ssh/known_hosts diff --git a/docker-rsync/hosts-clear b/docker-rsync/hosts-clear index 44ae71f..7bddd05 100755 --- a/docker-rsync/hosts-clear +++ b/docker-rsync/hosts-clear @@ -2,4 +2,4 @@ set -euo pipefail -truncate -s 0 ~/.ssh/known_hosts +truncate -s 0 $HOME/.ssh/known_hosts diff --git a/docker-rsync/hosts-init b/docker-rsync/hosts-init index d193ff8..a47d64b 100755 --- a/docker-rsync/hosts-init +++ b/docker-rsync/hosts-init @@ -2,5 +2,5 @@ set -euo pipefail -touch ~/.ssh/known_hosts -chmod 600 ~/.ssh/known_hosts +touch $HOME/.ssh/known_hosts +chmod 600 $HOME/.ssh/known_hosts diff --git a/docker-rsync/ssh-init b/docker-rsync/ssh-init index 1efab13..8f279ad 100755 --- a/docker-rsync/ssh-init +++ b/docker-rsync/ssh-init @@ -2,4 +2,4 @@ set -euo pipefail -mkdir -m 700 ~/.ssh +mkdir -m 700 $HOME/.ssh diff --git a/entrypoint.sh b/entrypoint.sh index 9f7d681..47ec5e5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,7 @@ fi STRICT_HOSTKEYS_CHECKING="-o StrictHostKeyChecking=no" if [ "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]; then - STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=~/.ssh/known_hosts -o StrictHostKeyChecking=yes" + STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=yes" key="$(ssh-keyscan -p "$INPUT_REMOTE_PORT" "$INPUT_REMOTE_HOST" 2>/dev/null | sed '/^#/d')" || key="" if [ -n "$key" ]; then @@ -38,7 +38,7 @@ if [ "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]; then set +x echo "debug" - cat "~/.ssh/known_hosts" + cat $HOME/.ssh/known_hosts else echo "Warning: failed to fetch host key for $INPUT_REMOTE_HOST" >&2 exit 1