blocklist from file
This commit is contained in:
parent
83b5e5fe77
commit
e816a33da1
|
@ -75,10 +75,12 @@ async def block_skylinks_from_airtable():
|
||||||
return print(message) or await send_msg(client, message, force_notify=False)
|
return print(message) or await send_msg(client, message, force_notify=False)
|
||||||
|
|
||||||
print("Searching nginx cache for blocked files")
|
print("Searching nginx cache for blocked files")
|
||||||
|
|
||||||
|
f = open("/tmp/blocklist-aritable.txt", "w")
|
||||||
|
f.write("^KEY: .*" + "^KEY: .*\n".join(skylinks))
|
||||||
|
f.close()
|
||||||
cached_files_command = (
|
cached_files_command = (
|
||||||
"/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -Els '^KEY: .*("
|
"/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -Els --file /tmp/blocklist-aritable.txt"
|
||||||
+ "|".join(skylinks)
|
|
||||||
+ ")'"
|
|
||||||
)
|
)
|
||||||
cached_files_count = int(exec('docker exec -it nginx bash -c "' + cached_files_command + ' | wc -l"') or 0)
|
cached_files_count = int(exec('docker exec -it nginx bash -c "' + cached_files_command + ' | wc -l"') or 0)
|
||||||
|
|
||||||
|
|
Reference in New Issue