mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
port-jobs: Allow server argument code to be removed by RMSERVER.py
Former-commit-id: 1e5c0df77643916b801a2965dddd72a2ca80597f Former-commit-id: 42cb73d51a99a91c763cda4192ae5f76a3235d7f
This commit is contained in:
@@ -51,3 +51,18 @@ new_text = re.sub(regex, replacement, text)
|
||||
|
||||
# write updated text
|
||||
open('working/sshyp.py', 'w').write(new_text)
|
||||
|
||||
# ARGS-SERVER
|
||||
# define PORT target
|
||||
string1 = '# PORT START ARGS-SERVER'
|
||||
string2 = '# PORT END ARGS-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\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