diff --git a/lib/sshyp.py b/lib/sshyp.py index bb19422..cd71830 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -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'): diff --git a/port-jobs/RMSERVER.PY b/port-jobs/RMSERVER.PY index 4b8ea5f..3006da4 100755 --- a/port-jobs/RMSERVER.PY +++ b/port-jobs/RMSERVER.PY @@ -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)