mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 09:07:13 -04:00
Updated port-jobs to allow for packaging the new config setup, fixed offline mode error
Former-commit-id: 511d1d887fb34b8613f063fc7992418bb614a740 Former-commit-id: 03f6817527864c52012de1d02bb2c34e8fed8a18
This commit is contained in:
+11
-11
@@ -31,25 +31,25 @@ new_text = re.sub(regex, '', text)
|
||||
# write updated text
|
||||
open('working/sshyp.py', 'w').write(new_text)
|
||||
|
||||
# TWEAK-DEVTYPE
|
||||
# TWEAK-DEVTYPE TODO Disabled due to new config menu changes, needs re-written so that device type cannot be set to server on RMSERVER devices
|
||||
# define PORT target
|
||||
string1 = '# PORT START TWEAK-DEVTYPE'
|
||||
string2 = '# PORT END TWEAK-DEVTYPE'
|
||||
#string1 = '# PORT START TWEAK-DEVTYPE'
|
||||
#string2 = '# PORT END TWEAK-DEVTYPE'
|
||||
|
||||
# set replacement text
|
||||
replacement = """if True:
|
||||
_sshyp_data = ['client']
|
||||
Path(f"{home}/.local/share/sshyp").mkdir(mode=0o700, parents=True, exist_ok=True)"""
|
||||
#replacement = """if True:
|
||||
# _sshyp_data = ['client']
|
||||
# Path(f"{home}/.local/share/sshyp").mkdir(mode=0o700, parents=True, exist_ok=True)"""
|
||||
|
||||
# read input file
|
||||
text = open('working/sshyp.py', 'r').read()
|
||||
## read input file
|
||||
#text = open('working/stweak.py', 'r').read()
|
||||
|
||||
# find and replace the defined PORT target
|
||||
regex = re.compile(f"{string1}.*?{string2}", re.DOTALL)
|
||||
new_text = re.sub(regex, replacement, text)
|
||||
#regex = re.compile(f"{string1}.*?{string2}", re.DOTALL)
|
||||
#new_text = re.sub(regex, replacement, text)
|
||||
|
||||
# write updated text
|
||||
open('working/sshyp.py', 'w').write(new_text)
|
||||
#open('working/stweak.py', 'w').write(new_text)
|
||||
|
||||
# ARGS-SERVER
|
||||
# define PORT target
|
||||
|
||||
Reference in New Issue
Block a user