mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 00:57:14 -04:00
port-jobs: Allow server whitelist code to be removed by RMSERVER.py
Former-commit-id: f810415074bcdb87725437f6ef8be775c21524b5 Former-commit-id: c2bb6e673e44b6f70b08a850a93f94c59ac44f90
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import re
|
||||
from sys import argv, exit as s_exit
|
||||
|
||||
# SSHYNC-REMOTE
|
||||
# define PORT target
|
||||
string1 = '# PORT START SSHYNC-REMOTE'
|
||||
string2 = '# PORT END SSHYNC-REMOTE'
|
||||
@@ -15,3 +16,18 @@ new_text = re.sub(regex, '', text)
|
||||
|
||||
# write updated text
|
||||
open('working/sshync.py', 'w').write(new_text)
|
||||
|
||||
# WHITELIST-SERVER
|
||||
# define PORT target
|
||||
string1 = '# PORT START WHITELIST-SERVER'
|
||||
string2 = '# PORT END WHITELIST-SERVER'
|
||||
|
||||
# read input file
|
||||
text = open('working/sshyp.py', 'r').read()
|
||||
|
||||
# find and replace the defined PORT target
|
||||
regex = re.compile(f"\n{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