19 lines
441 B
Python
19 lines
441 B
Python
#!/usr/bin/env python3
|
|
path = "/var/www/html/api/handlers/l99-honest-refresh.sh"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
patches = [
|
|
(b"MO=$(timeout 200 php -r", b"MO=$(timeout 280 php -r"),
|
|
(b"OO=$(timeout 300 php -r", b"OO=$(timeout 400 php -r"),
|
|
]
|
|
count = 0
|
|
for o, n in patches:
|
|
if o in raw:
|
|
raw = raw.replace(o, n, 1)
|
|
count += 1
|
|
|
|
with open(path, "wb") as f:
|
|
f.write(raw)
|
|
print(f"patched {count}")
|