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:
2023-04-18 15:06:16 -04:00
parent b2cfa5d8f2
commit a13f20db76
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -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'):
+15
View File
@@ -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)