ops: Update check script for config.js URL

This commit is contained in:
wiz 2024-04-01 18:43:44 +09:00
parent df491d050d
commit bf5d5b98cb
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -1,8 +1,7 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
#for j in fmt va1 fra tk7;do for i in 1 2 3 4 5 6;do echo -n 20$i.$j: ;curl -i -s https://node20$i.$j.mempool.space/api/v1/services/accelerator/accelerations|head -1;done;done #for j in fmt va1 fra tk7;do for i in 1 2 3 4 5 6;do echo -n 20$i.$j: ;curl -i -s https://node20$i.$j.mempool.space/api/v1/services/accelerator/accelerations|head -1;done;done
check_mempoolspace_frontend_git_hash() { check_mempoolspace_frontend_git_hash() {
echo curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/resources/config.js echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/en-US/resources/config.js|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8)
echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/resources/config.js|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8)
} }
check_mempoolfoss_frontend_git_hash() { check_mempoolfoss_frontend_git_hash() {
echo -n $(curl -s "https://node${1}.${2}.mempool.space/resources/config.js"|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8) echo -n $(curl -s "https://node${1}.${2}.mempool.space/resources/config.js"|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8)
@ -13,19 +12,24 @@ check_mempoolspace_frontend_md5_hash() {
check_mempoolfoss_frontend_md5_hash() { check_mempoolfoss_frontend_md5_hash() {
echo -n $(curl -s https://node${1}.${2}.mempool.space|md5|cut -c1-8) echo -n $(curl -s https://node${1}.${2}.mempool.space|md5|cut -c1-8)
} }
check_mempool_electrs_git_hash() {
echo -n $(curl -s -i https://node${1}.${2}.mempool.space/api/mempool|grep -i x-powered-by|cut -d ' ' -f3)
}
for site in fmt va1 fra tk7;do for site in fmt va1 fra tk7;do
echo "${site}" echo "${site}"
for node in 201 202 203 204 205 206 207 208 209 210 211 212 213 214;do for node in 201 202 203 204 205 206 207 208 209 210 211 212 213 214;do
[ "${site}" = "fmt" ] && [ "${node}" -gt 206 ] && continue [ "${site}" = "fmt" ] && [ "${node}" -gt 206 ] && continue
[ "${site}" = "tk7" ] && [ "${node}" -gt 206 ] && continue [ "${site}" = "tk7" ] && [ "${node}" -gt 206 ] && continue
echo -n "node${node}.${site}: " echo -n "node${node}.${site}: "
#check_mempoolspace_frontend_git_hash $node $site check_mempoolspace_frontend_git_hash $node $site
#echo -n " "
check_mempoolspace_frontend_md5_hash $node $site
echo -n " " echo -n " "
check_mempoolfoss_frontend_git_hash $node $site check_mempoolfoss_frontend_git_hash $node $site
echo -n " " echo -n " "
check_mempoolspace_frontend_md5_hash $node $site
echo -n " "
check_mempoolfoss_frontend_md5_hash $node $site check_mempoolfoss_frontend_md5_hash $node $site
echo -n " "
check_mempool_electrs_git_hash $node $site
echo echo
done done
done done