update set_var module

This commit is contained in:
Matthieu Lamalle 2021-07-05 10:13:40 +02:00
parent 7b4414b137
commit 27bdbf5e4f
1 changed files with 7 additions and 3 deletions

View File

@ -41,16 +41,20 @@ def main():
# import des fonctions communes de Zéphir client
varc, valvar, save = argparser()
fh = open("/etc/eole/config.eol", 'r')
store = cjson.decode(fh.read(), all_unicode=True)
fh.close
if varc is None :
print
print('Liste des variables modifiables :')
for var in store:
print(' - ' + var)
varc = raw_input("Variable à modifier : ")
if valvar is None :
valvar = raw_input("Valeur de la variable : ")
fh = open("/etc/eole/config.eol", 'r')
store = cjson.decode(fh.read(), all_unicode=True)
fh.close
if varc in store:
if "|" in valvar:
valvar = valvar.split("|")