updated example for presistence

This commit is contained in:
Brian Merriam 2023-03-28 14:54:44 +00:00
parent c7123c8118
commit 6401862066
2 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -86,3 +86,4 @@ sftp-config.json
### pyCraft ###
credentials
Persistence/*

View File

@ -135,7 +135,13 @@ def main():
try:
auth_token = authentication.Microsoft_AuthenticationToken()
auth_token.authenticate()
if options.username:
if not auth_token.PersistenceLogoin_r(options.username):
print("Login to {} failed".format(options.username))
sys.exit(1)
else:
if not auth_token.authenticate():
sys.exit(2)
except YggdrasilError as e:
print(e)
sys.exit()