Merge pull request #4 from StijnBTC/development

automaticly detect umbrel OS and change default lnd directory
This commit is contained in:
Stijn 2021-08-02 15:22:36 +02:00 committed by GitHub
commit 6e47b57343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import sys
from lnd import Lnd from lnd import Lnd
from output import Output from output import Output
from status import Status from status import Status
from utils import is_umbrel
class RingTools: class RingTools:
@ -38,11 +39,16 @@ def get_argument_parser():
"like to use", "like to use",
default="help", 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( parser.add_argument(
"--lnddir", "--lnddir",
default="~/.lnd", default=lnd_dir,
dest="lnddir", dest="lnddir",
help="(default ~/.lnd) lnd directory", help="(default ~/.lnd or ~/umbrel/umbrel/lnd/ when default umbrel installation) lnd directory",
) )
parser.add_argument( parser.add_argument(
"--grpc", "--grpc",

5
utils.py Normal file
View file

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