diff --git a/packages/ns-api/files/ns.factoryreset b/packages/ns-api/files/ns.factoryreset new file mode 100755 index 000000000..1cc3707c3 --- /dev/null +++ b/packages/ns-api/files/ns.factoryreset @@ -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)) diff --git a/packages/ns-api/files/ns.factoryreset.json b/packages/ns-api/files/ns.factoryreset.json new file mode 100644 index 000000000..6bf1d0020 --- /dev/null +++ b/packages/ns-api/files/ns.factoryreset.json @@ -0,0 +1,13 @@ +{ + "factoryreset": { + "description": "Factory reset firmware", + "write": {}, + "read": { + "ubus": { + "ns.factoryreset": [ + "*" + ] + } + } + } +}