Skip to content

Commit

Permalink
Add CLI args
Browse files Browse the repository at this point in the history
  • Loading branch information
z1pti3 committed Mar 6, 2021
1 parent 8deda03 commit e6d8792
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions jimi_cli.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
from screens import mainScreen
screen = mainScreen.mainScreen()
import sys

if len(sys.argv) > 1:
if sys.argv[1] == "reset":
if sys.argv[2] == "root":
from core import auth
from system import install
rootUser = auth._user().getAsClass(query={ "username" : "root" })
if len(rootUser) == 1:
rootUser = rootUser[0]
rootPass = install.randomString(30)
rootUser.setAttribute("passwordHash",rootPass)
rootUser.update(["passwordHash"])
print("Password={0}".format(rootPass))
else:
from screens import mainScreen
screen = mainScreen.mainScreen()

0 comments on commit e6d8792

Please sign in to comment.