Browse Source

Change pathnames in scripts

master
nolim1t 5 years ago
parent
commit
fa74112247
No known key found for this signature in database GPG Key ID: F6287B82CC84BCBD
  1. 12
      stage2/04-docker-compose/files/umbrel-createwallet.py
  2. 4
      stage2/04-docker-compose/files/umbrel-unlock.py

12
stage2/04-docker-compose/files/umbrel-createwallet.py

@ -32,7 +32,7 @@ import random, string
url = 'https://localhost:8080/v1/genseed'
# Initialize wallet
url2 = 'https://localhost:8080/v1/initwallet'
cert_path = '/home/umbrel/.lnd/tls.cert'
cert_path = '/home/umbrel/lnd/tls.cert'
seed_filename = '/home/umbrel/seed.txt'
# save password control file (Add this file if we want to save passwords)
@ -53,7 +53,7 @@ def main():
password_str=randompass(stringLength=15)
temp_password_file = open(temp_password_file_path, "w")
# Check if there is an existing file, if not generate a random password
if not os.path.exists("/home/umbrel/.lnd/sesame.txt"):
if not os.path.exists("/home/umbrel/lnd/sesame.txt"):
# sesame file doesnt exist
password_str=randompass(stringLength=15)
if not os.path.exists(save_password_control_file):
@ -63,12 +63,12 @@ def main():
temp_password_file.close()
else:
# Use sesame.txt if password_control_file exists
password_file = open("/home/umbrel/.lnd/sesame.txt","w")
password_file = open("/home/umbrel/lnd/sesame.txt","w")
password_file.write(password_str)
password_file.close()
else:
# Get password from file if sesame file already exists
password_str = open('/home/umbrel/.lnd/sesame.txt', 'r').read().rstrip()
password_str = open('/home/umbrel/lnd/sesame.txt', 'r').read().rstrip()
# Convert password to byte encoded
password_bytes = str(password_str).encode('utf-8')
@ -125,8 +125,8 @@ docker stop compose_lndbox_1 ; rm -fr /media/important/important/lnd/data/chain/
'''
if __name__ == '__main__':
if os.path.exists("/home/umbrel/.lnd"):
if not os.path.exists("/home/umbrel/.lnd/data/chain/bitcoin/mainnet/wallet.db"):
if os.path.exists("/home/umbrel/lnd"):
if not os.path.exists("/home/umbrel/lnd/data/chain/bitcoin/mainnet/wallet.db"):
main()
else:
print('Wallet already exists! Please delete .lnd/data/chain and then restart LND')

4
stage2/04-docker-compose/files/umbrel-unlock.py

@ -2,8 +2,8 @@
import base64, codecs, json, requests
url = 'https://localhost:8080/v1/unlockwallet'
cert_path = '/home/umbrel/.lnd/tls.cert'
password_str = open('/home/umbrel/.lnd/sesame.txt', 'r').read().rstrip()
cert_path = '/home/umbrel/lnd/tls.cert'
password_str = open('/home/umbrel/lnd/sesame.txt', 'r').read().rstrip()
password_bytes = str(password_str).encode('utf-8')
data = {
'wallet_password': base64.b64encode(password_bytes).decode(),

Loading…
Cancel
Save