mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 22:58:43 +01:00
rework output
This commit is contained in:
parent
0fe5ca04ad
commit
4522ac2f92
1 changed files with 43 additions and 18 deletions
|
@ -167,9 +167,14 @@ def main():
|
||||||
parser.add_argument("-p", "--print",
|
parser.add_argument("-p", "--print",
|
||||||
help="print parsed config", action="store_true")
|
help="print parsed config", action="store_true")
|
||||||
|
|
||||||
|
parser.add_argument("-q", "--quiet",
|
||||||
|
help="suppress normal output", action="store_true")
|
||||||
|
|
||||||
|
|
||||||
# parse args
|
# parse args
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
# LND Config
|
# LND Config
|
||||||
lnd_cfg_valid = False
|
lnd_cfg_valid = False
|
||||||
|
|
||||||
|
@ -177,15 +182,18 @@ def main():
|
||||||
if os.path.exists(lnd_cfg.abs_path):
|
if os.path.exists(lnd_cfg.abs_path):
|
||||||
try:
|
try:
|
||||||
lnd_cfg.reload()
|
lnd_cfg.reload()
|
||||||
|
|
||||||
lnd_cfg_valid = True
|
lnd_cfg_valid = True
|
||||||
print("LND Config: \t\tOK")
|
if not args.quiet:
|
||||||
|
print("LND Config: \t\tOK")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print("LND Config: \t\tERROR")
|
if not args.quiet:
|
||||||
log.warning(err)
|
print("LND Config: \t\tERROR")
|
||||||
|
log.warning(err)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("LND Config: \t\tMISSING")
|
if not args.quiet:
|
||||||
|
print("LND Config: \t\tMISSING")
|
||||||
|
|
||||||
|
|
||||||
# Raspi Config
|
# Raspi Config
|
||||||
|
@ -197,13 +205,16 @@ def main():
|
||||||
rb_cfg.reload()
|
rb_cfg.reload()
|
||||||
|
|
||||||
rb_cfg_valid = True
|
rb_cfg_valid = True
|
||||||
print("RaspiBlitz Config: \tOK")
|
if not args.quiet:
|
||||||
|
print("RaspiBlitz Config: \tOK")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print("RaspiBlitz Config: \tERROR")
|
if not args.quiet:
|
||||||
log.warning(err)
|
print("RaspiBlitz Config: \tERROR")
|
||||||
|
log.warning(err)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("RaspiBlitz Config: \tmissing")
|
if not args.quiet:
|
||||||
|
print("RaspiBlitz Config: \tMISSING")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,25 +227,32 @@ def main():
|
||||||
rb_info.reload()
|
rb_info.reload()
|
||||||
|
|
||||||
rb_info_valid = True
|
rb_info_valid = True
|
||||||
print("RaspiBlitz Info: \tOK")
|
if not args.quiet:
|
||||||
|
print("RaspiBlitz Info: \tOK")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print("RaspiBlitz Info: \tERROR")
|
if not args.quiet:
|
||||||
log.warning(err)
|
print("RaspiBlitz Info: \tERROR")
|
||||||
|
log.warning(err)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("RaspiBlitz Info: \tmissing")
|
if not args.quiet:
|
||||||
|
print("RaspiBlitz Info: \tMISSING")
|
||||||
|
|
||||||
|
|
||||||
if args.print:
|
if args.print:
|
||||||
|
print("=======\n= LND =\n=======")
|
||||||
if lnd_cfg_valid:
|
if lnd_cfg_valid:
|
||||||
print("=======\n= LND =\n=======")
|
|
||||||
print("rpc_list: \t\t{}".format(lnd_cfg.rpc_listen))
|
print("rpc_list: \t\t{}".format(lnd_cfg.rpc_listen))
|
||||||
print("rpc_list_host: \t\t{}".format(lnd_cfg.rpc_listen_host))
|
print("rpc_list_host: \t\t{}".format(lnd_cfg.rpc_listen_host))
|
||||||
print("rpc_list_port: \t\t{}".format(lnd_cfg.rpc_listen_port))
|
print("rpc_list_port: \t\t{}".format(lnd_cfg.rpc_listen_port))
|
||||||
print("")
|
print("")
|
||||||
|
else:
|
||||||
|
print("invalid or missing")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
|
||||||
|
print("====================\n= RaspiBlitzConfig =\n====================")
|
||||||
if rb_cfg_valid:
|
if rb_cfg_valid:
|
||||||
print("====================\n= RaspiBlitzConfig =\n====================")
|
|
||||||
print("auto_nat_discovery: \t\t{}".format(rb_cfg.auto_nat_discovery))
|
print("auto_nat_discovery: \t\t{}".format(rb_cfg.auto_nat_discovery))
|
||||||
print("auto_pilot: \t\t\t{}".format(rb_cfg.auto_pilot))
|
print("auto_pilot: \t\t\t{}".format(rb_cfg.auto_pilot))
|
||||||
print("auto_unlock: \t\t\t{}".format(rb_cfg.auto_unlock))
|
print("auto_unlock: \t\t\t{}".format(rb_cfg.auto_unlock))
|
||||||
|
@ -255,12 +273,19 @@ def main():
|
||||||
print("touchscreen: \t\t\t{}".format(rb_cfg.touchscreen))
|
print("touchscreen: \t\t\t{}".format(rb_cfg.touchscreen))
|
||||||
print("version: \t\t\t{}".format(rb_cfg.version))
|
print("version: \t\t\t{}".format(rb_cfg.version))
|
||||||
print("")
|
print("")
|
||||||
|
else:
|
||||||
|
print("invalid or missing")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
|
||||||
|
print("==================\n= RaspiBlitzInfo =\n==================")
|
||||||
if rb_info_valid:
|
if rb_info_valid:
|
||||||
print("==================\n= RaspiBlitzInfo =\n==================")
|
|
||||||
print("state: \t\t{}".format(rb_info.state))
|
print("state: \t\t{}".format(rb_info.state))
|
||||||
print("")
|
print("")
|
||||||
|
else:
|
||||||
|
print("invalid or missing")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
|
||||||
if rb_cfg_valid:
|
if rb_cfg_valid:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue