storage healthcheck - ignore known_hosts

This commit is contained in:
Oleg Sheynin 2025-01-22 17:48:13 -05:00
parent 5671ec5044
commit 5905e3fe3a
2 changed files with 17 additions and 14 deletions

View File

@ -1 +1 @@
1.9.5,homestore ==> hs01 1.9.6,storage healthcheck - ignore known_hosts

View File

@ -19,13 +19,13 @@ get_user_hosts() {
local Domain=${2} local Domain=${2}
Cmd="curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts" Cmd="curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts"
Cmd="${Cmd} | ${HOME}/bin/hjson -j" Cmd+=" | ${HOME}/bin/hjson -j"
Cmd="${Cmd} | jq -r" Cmd+=" | jq -r"
Cmd="${Cmd} --arg domain \"${Domain}\"" Cmd+=" --arg domain \"${Domain}\""
Cmd="${Cmd} --arg usr \"${User}\"" Cmd+=" --arg usr \"${User}\""
Cmd="${Cmd} '.[\$domain] | to_entries[] | select(.value.users[] | contains(\$usr)) | .key'" Cmd+=" '.[\$domain] | to_entries[] | select(.value.users[] | contains(\$usr)) | .key'"
Cmd="${Cmd} | sed 's/\$/.${Domain}/'" Cmd+=" | sed 's/\$/.${Domain}/'"
eval ${Cmd} eval ${Cmd}
} }
@ -66,13 +66,16 @@ function storage_check() {
else else
port=22 port=22
fi fi
Cmd="ssh -p ${port} $host" Cmd="ssh -p ${port}"
Cmd="${Cmd} eval \"df -hTl" Cmd+=" -o StrictHostKeyChecking=no"
Cmd="${Cmd} -x squashfs" Cmd+=" -o UserKnownHostsFile=/dev/null"
Cmd="${Cmd} -x tmpfs" Cmd+=" $host"
Cmd="${Cmd} -x vfat" Cmd+=" eval \"df -hTl"
Cmd="${Cmd} -x devtmpfs" Cmd+=" -x squashfs"
Cmd="${Cmd} | grep -v Filesystem\"" Cmd+=" -x tmpfs"
Cmd+=" -x vfat"
Cmd+=" -x devtmpfs"
Cmd+=" | grep -v Filesystem\""
IFS=$'\n' ; lines=$(eval ${Cmd}) IFS=$'\n' ; lines=$(eval ${Cmd})
for ln in $lines for ln in $lines