automaticly detect umbrel OS and change default lnd directory

This commit is contained in:
StijnBTC 2021-08-02 15:20:55 +02:00
parent eeee55b19d
commit 0786f7d426
No known key found for this signature in database
GPG key ID: B1E4DFC4452D1E7F
2 changed files with 13 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import sys
from lnd import Lnd
from output import Output
from status import Status
from utils import is_umbrel
class RingTools:
@ -38,11 +39,16 @@ def get_argument_parser():
"like to use",
default="help",
)
#If nodeos is Umbrel use the default umbrel lnd location
lnd_dir = "~/.lnd"
if is_umbrel():
lnd_dir = "~/umbrel/umbrel/lnd/"
parser.add_argument(
"--lnddir",
default="~/.lnd",
default=lnd_dir,
dest="lnddir",
help="(default ~/.lnd) lnd directory",
help="(default ~/.lnd or ~/umbrel/umbrel/lnd/ when default umbrel installation) lnd directory",
)
parser.add_argument(
"--grpc",

5
utils.py Normal file
View file

@ -0,0 +1,5 @@
import os
def is_umbrel():
return os.uname().nodename == "umbrel"