Merge pull request #1303 from SkynetLabs/fix-blocklist-skylink

Fix blocklist skylink script
This commit is contained in:
Ivaylo Novakov 2021-10-22 15:42:53 +02:00 committed by GitHub
commit d9ba0d754c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -0,0 +1,2 @@
- Fix `blocklist-skylink.sh` script that didn't removed blocked skylink from
nginx cache.

View File

@ -54,12 +54,12 @@ do
for skylink in "${skylinks[@]}";
do
echo ".. ⌁ Blocking skylink ${skylink} on ${server}"
# Add to blocklist
ssh -q -t user@${server} "docker exec sia siac skynet blocklist add ${skylink}"
# Remove from NGINX cache
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Elsq '^Skynet-Skylink: ${skylink}'"
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Els '^Skynet-Skylink: ${skylink}'"
ssh -q -t user@${server} "docker exec -it nginx bash -c ${cached_files_command} | xargs -r rm"
echo ".. ⌁ Skylink ${skylink} Blocked on ${server}"