mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 00:57:14 -04:00
Former-commit-id: a5539fd86288aabf392b8f226100d232ee46514d Former-commit-id: 19306b84cf881ba17d119675195bef84e6ab5fa2
18 lines
442 B
Python
Executable File
18 lines
442 B
Python
Executable File
#!/usr/bin/env python3
|
|
import re
|
|
from sys import argv, exit as s_exit
|
|
|
|
# define PORT target
|
|
string1 = '# PORT START SSHYNC-REMOTE'
|
|
string2 = '# PORT END SSHYNC-REMOTE'
|
|
|
|
# read input file
|
|
text = open('working/sshync.py', 'r').read()
|
|
|
|
# find and replace the defined PORT target
|
|
regex = re.compile(f"\n{string1}.*?{string2}\n\n", re.DOTALL)
|
|
new_text = re.sub(regex, '', text)
|
|
|
|
# write updated text
|
|
open('working/sshync.py', 'w').write(new_text)
|