from pathlib import Path
path=Path('/etc/caddy/Caddyfile')
s=path.read_text()
old='reverse_proxy http://127.0.0.1:8090 http://74.48.114.71:48090 http://103.114.163.226:48090 {'
new='reverse_proxy http://127.0.0.1:8090 http://103.114.163.226:48090 {'
if old not in s:
    raise SystemExit('target upstream line not found')
path.write_text(s.replace(old,new,1))
