mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -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:
@@ -892,6 +892,7 @@ if __name__ == "__main__":
|
||||
success_flag = True
|
||||
read_shortcut()
|
||||
|
||||
# PORT START ARGS-SERVER
|
||||
# server arguments
|
||||
else:
|
||||
if arg_count < 1:
|
||||
@@ -907,6 +908,7 @@ if __name__ == "__main__":
|
||||
elif arguments[1] == 'setup':
|
||||
success_flag = True
|
||||
whitelist_setup()
|
||||
# PORT END ARGS-SERVER
|
||||
|
||||
if arg_count > 0 and success_flag == 0 and arguments[0] != 'sync':
|
||||
if device_type == 'client' and arguments[0] not in ('help', '-h', 'version', '-v', 'license'):
|
||||
|
||||
@@ -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