mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 07:07:18 -04:00
Fixed and re-enabled TWEAK-DEVTYPE port-job
Former-commit-id: 15038a5b6446b1356d6e45fd17111412bcd2072f Former-commit-id: 9b6a5624f009d9b158b3ee722c2cd220582e8374
This commit is contained in:
+1
-1
@@ -83,6 +83,7 @@ def install_type():
|
|||||||
# PORT START TWEAK-DEVTYPE
|
# PORT START TWEAK-DEVTYPE
|
||||||
_install_type = curses_radio(('client (ssh-synchronized)', 'client (offline)', 'server'),
|
_install_type = curses_radio(('client (ssh-synchronized)', 'client (offline)', 'server'),
|
||||||
'device + sync type configuration')
|
'device + sync type configuration')
|
||||||
|
# PORT END TWEAK-DEVTYPE
|
||||||
if _install_type == 2:
|
if _install_type == 2:
|
||||||
_dev_type = 'server'
|
_dev_type = 'server'
|
||||||
Path(f"{home}/.config/sshyp/deleted").mkdir(mode=0o700, exist_ok=True)
|
Path(f"{home}/.config/sshyp/deleted").mkdir(mode=0o700, exist_ok=True)
|
||||||
@@ -99,7 +100,6 @@ def install_type():
|
|||||||
sshyp_data.add_section('GENERAL')
|
sshyp_data.add_section('GENERAL')
|
||||||
sshyp_data.set('GENERAL', 'device_type', _dev_type)
|
sshyp_data.set('GENERAL', 'device_type', _dev_type)
|
||||||
write_config()
|
write_config()
|
||||||
# PORT END TWEAK-DEVTYPE
|
|
||||||
return _dev_type, _offline_mode
|
return _dev_type, _offline_mode
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+9
-10
@@ -31,25 +31,24 @@ new_text = re.sub(regex, '', text)
|
|||||||
# write updated text
|
# write updated text
|
||||||
open('working/sshyp.py', 'w').write(new_text)
|
open('working/sshyp.py', 'w').write(new_text)
|
||||||
|
|
||||||
# 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
|
# TWEAK-DEVTYPE
|
||||||
# define PORT target
|
# define PORT target
|
||||||
#string1 = '# PORT START TWEAK-DEVTYPE'
|
string1 = '# PORT START TWEAK-DEVTYPE'
|
||||||
#string2 = '# PORT END TWEAK-DEVTYPE'
|
string2 = '# PORT END TWEAK-DEVTYPE'
|
||||||
|
|
||||||
# set replacement text
|
# set replacement text
|
||||||
#replacement = """if True:
|
replacement = """_install_type = curses_radio(('client (ssh-synchronized)', 'client (offline)'),
|
||||||
# _sshyp_data = ['client']
|
'device + sync type configuration')"""
|
||||||
# Path(f"{home}/.local/share/sshyp").mkdir(mode=0o700, parents=True, exist_ok=True)"""
|
|
||||||
|
|
||||||
## read input file
|
## read input file
|
||||||
#text = open('working/stweak.py', 'r').read()
|
text = open('working/stweak.py', 'r').read()
|
||||||
|
|
||||||
# find and replace the defined PORT target
|
# find and replace the defined PORT target
|
||||||
#regex = re.compile(f"{string1}.*?{string2}", re.DOTALL)
|
regex = re.compile(f"{string1}.*?{string2}", re.DOTALL)
|
||||||
#new_text = re.sub(regex, replacement, text)
|
new_text = re.sub(regex, replacement, text)
|
||||||
|
|
||||||
# write updated text
|
# write updated text
|
||||||
#open('working/stweak.py', 'w').write(new_text)
|
open('working/stweak.py', 'w').write(new_text)
|
||||||
|
|
||||||
# ARGS-SERVER
|
# ARGS-SERVER
|
||||||
# define PORT target
|
# define PORT target
|
||||||
|
|||||||
Reference in New Issue
Block a user