from __future__ import annotations import pathlib import sys source = pathlib.Path(sys.argv[1]) target = pathlib.Path(sys.argv[2]) lines = source.read_text( encoding="utf-8", ).splitlines() output = [ line for line in lines if not line.startswith( "SHIRE_MOBILE_GATEWAY_PREVIOUS_TOKEN=" ) ] target.write_text( "\n".join(output) + "\n", encoding="utf-8", ) target.chmod(0o600)