mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 09:07:13 -04:00
port-jobs: Allow server help code to be removed by RMSERVER.py
Former-commit-id: cb58ed696f9aca18b95297d784b1c021ec9f3461 Former-commit-id: b1d93eedcc74812fa68b8624c9a6490e8f58e565
This commit is contained in:
@@ -66,3 +66,18 @@ new_text = re.sub(regex, '', text)
|
||||
|
||||
# write updated text
|
||||
open('working/sshyp.py', 'w').write(new_text)
|
||||
|
||||
# HELP-SERVER
|
||||
# define PORT target
|
||||
string1 = '# PORT START HELP-SERVER'
|
||||
string2 = '# PORT END HELP-SERVER'
|
||||
|
||||
# read input file
|
||||
text = open('working/sshyp.py', 'r').read()
|
||||
|
||||
# find and replace the defined PORT target
|
||||
regex = re.compile(f"{string1}.*?{string2}\n", re.DOTALL)
|
||||
new_text = re.sub(regex, '', text)
|
||||
|
||||
# write updated text
|
||||
open('working/sshyp.py', 'w').write(new_text)
|
||||
|
||||
Reference in New Issue
Block a user