Skip to content

Commit

Permalink
ns-api: add ns.factoryreset (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
andre8244 committed Nov 10, 2023
1 parent 664f57c commit 4f63c87
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/ns-api/files/ns.factoryreset
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python3

#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#

# Factory reset firmware

import sys
import json

cmd = sys.argv[1]

if cmd == 'list':
print(json.dumps({"reset": {}}))
elif cmd == 'call':
action = sys.argv[2]
if action == "reset":
ret = {"result": "success"}
print(json.dumps(ret))
13 changes: 13 additions & 0 deletions packages/ns-api/files/ns.factoryreset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"factoryreset": {
"description": "Factory reset firmware",
"write": {},
"read": {
"ubus": {
"ns.factoryreset": [
"*"
]
}
}
}
}

0 comments on commit 4f63c87

Please sign in to comment.