Skip to content

Commit e6d8792

Browse files
committed
Add CLI args
1 parent 8deda03 commit e6d8792

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

jimi_cli.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
from screens import mainScreen
2-
screen = mainScreen.mainScreen()
1+
import sys
2+
3+
if len(sys.argv) > 1:
4+
if sys.argv[1] == "reset":
5+
if sys.argv[2] == "root":
6+
from core import auth
7+
from system import install
8+
rootUser = auth._user().getAsClass(query={ "username" : "root" })
9+
if len(rootUser) == 1:
10+
rootUser = rootUser[0]
11+
rootPass = install.randomString(30)
12+
rootUser.setAttribute("passwordHash",rootPass)
13+
rootUser.update(["passwordHash"])
14+
print("Password={0}".format(rootPass))
15+
else:
16+
from screens import mainScreen
17+
screen = mainScreen.mainScreen()

0 commit comments

Comments
 (0)