Browse Source

update logging

#146
Robert Habermann 6 years ago
parent
commit
4b341336b4
  1. 12
      home.admin/AAunlockLND.py

12
home.admin/AAunlockLND.py

@ -48,7 +48,7 @@ def _read_macaroon(lnd_macaroon_file):
def check_locked(password_file, lnd_cert_file, lnd_macaroon_file, host="localhost", port="8080", verbose=False): def check_locked(password_file, lnd_cert_file, lnd_macaroon_file, host="localhost", port="8080", verbose=False):
# check locked # check locked
if verbose: if verbose:
print("Checking for lock with the following data:") print("Checking for lock")
passwd_b64 = _read_pwd(password_file) passwd_b64 = _read_pwd(password_file)
macaroon_hex_dump = _read_macaroon(lnd_macaroon_file) macaroon_hex_dump = _read_macaroon(lnd_macaroon_file)
@ -76,7 +76,7 @@ def check_locked(password_file, lnd_cert_file, lnd_macaroon_file, host="localhos
def unlock(password_file, lnd_cert_file, lnd_macaroon_file, host="localhost", port="8080", verbose=False): def unlock(password_file, lnd_cert_file, lnd_macaroon_file, host="localhost", port="8080", verbose=False):
if verbose: if verbose:
print("Trying to unlock with the following data:") print("Trying to unlock")
passwd_b64 = _read_pwd(password_file) passwd_b64 = _read_pwd(password_file)
macaroon_hex_dump = _read_macaroon(lnd_macaroon_file) macaroon_hex_dump = _read_macaroon(lnd_macaroon_file)
@ -146,11 +146,11 @@ def main():
if check_locked(password_file, lnd_cert_file, lnd_macaroon_file, if check_locked(password_file, lnd_cert_file, lnd_macaroon_file,
host=options.host, port=options.port, verbose=options.verbose): host=options.host, port=options.port, verbose=options.verbose):
print("\033[93m{}\033[00m".format("Locked"))
else:
if options.verbose: if options.verbose:
print("\033[92m{}\033[00m".format("Not Locked")) print("\033[93m{}\033[00m".format("Locked"))
sys.exit(1) else:
print("\033[92m{}\033[00m".format("Not Locked"))
sys.exit(1)
if unlock(password_file, lnd_cert_file, lnd_macaroon_file, if unlock(password_file, lnd_cert_file, lnd_macaroon_file,
host=options.host, port=options.port, verbose=options.verbose): host=options.host, port=options.port, verbose=options.verbose):

Loading…
Cancel
Save