first commit
This commit is contained in:
25
buildroot/bin/opt_set
Executable file
25
buildroot/bin/opt_set
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys, os, config
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
if len(args) % 2 != 0:
|
||||
print("ERROR: Please provide pairs of <name> <value>")
|
||||
return
|
||||
|
||||
for i in range(0, len(args), 2):
|
||||
name = args[i]
|
||||
value = args[i + 1]
|
||||
changed = False
|
||||
|
||||
for file in config.FILES:
|
||||
if os.path.exists(file):
|
||||
if config.set(file, name, value):
|
||||
changed = True
|
||||
|
||||
if not changed:
|
||||
config.add(config.FILES[0], name, value)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user