Auto device type detection

This commit is contained in:
Taylor Helsper 2019-10-29 21:22:11 -05:00
parent 13c3605ce5
commit 6abe78e88f
6 changed files with 6 additions and 94 deletions

View File

@ -1,30 +0,0 @@
CONFIG = {}
# Device Config
CONFIG["device_type"] = "debian"
# Enabled Features
CONFIG["rtl_enabled"] = True
CONFIG["lndhub_enabled"] = True
CONFIG["electrs_enabled"] = True
CONFIG["explorer_enabled"] = True
CONFIG["btcrpcexplorer_enabled"] = True
# myNode variables
LATEST_VERSION_URL = "http://www.mynodebtc.com/device/latest_version"
CHECKIN_URL = "http://www.mynodebtc.com/device_api/check_in.php"
# Bitcoin Variables
BITCOIN_ENV_FILE = "/mnt/hdd/mynode/bitcoin/env"
BITCOIN_SYNCED_FILE = "/mnt/hdd/mynode/.mynode_bitcoind_synced"
# LND Variables
LND_WALLET_FILE = "/mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/wallet.db"
LND_DATA_FOLDER = "/mnt/hdd/mynode/lnd/data/"
# Other Variables
ELECTRS_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_electrs_enabled"
LNDHUB_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_lndhub_enabled"
BTCRPCEXPLORER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
VPN_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_vpn_enabled"

View File

@ -1,30 +0,0 @@
CONFIG = {}
# Device Config
CONFIG["device_type"] = "raspi3"
# Enabled Features
CONFIG["rtl_enabled"] = True
CONFIG["lndhub_enabled"] = True
CONFIG["electrs_enabled"] = True
CONFIG["explorer_enabled"] = True
CONFIG["btcrpcexplorer_enabled"] = True
# myNode variables
LATEST_VERSION_URL = "http://www.mynodebtc.com/device/latest_version"
CHECKIN_URL = "http://www.mynodebtc.com/device_api/check_in.php"
# Bitcoin Variables
BITCOIN_ENV_FILE = "/mnt/hdd/mynode/bitcoin/env"
BITCOIN_SYNCED_FILE = "/mnt/hdd/mynode/.mynode_bitcoind_synced"
# LND Variables
LND_WALLET_FILE = "/mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/wallet.db"
LND_DATA_FOLDER = "/mnt/hdd/mynode/lnd/data/"
# Other Variables
ELECTRS_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_electrs_enabled"
LNDHUB_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_lndhub_enabled"
BTCRPCEXPLORER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
VPN_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_vpn_enabled"

View File

@ -1,30 +0,0 @@
CONFIG = {}
# Device Config
CONFIG["device_type"] = "raspi4"
# Enabled Features
CONFIG["rtl_enabled"] = True
CONFIG["lndhub_enabled"] = True
CONFIG["electrs_enabled"] = True
CONFIG["explorer_enabled"] = True
CONFIG["btcrpcexplorer_enabled"] = True
# myNode variables
LATEST_VERSION_URL = "http://www.mynodebtc.com/device/latest_version"
CHECKIN_URL = "http://www.mynodebtc.com/device_api/check_in.php"
# Bitcoin Variables
BITCOIN_ENV_FILE = "/mnt/hdd/mynode/bitcoin/env"
BITCOIN_SYNCED_FILE = "/mnt/hdd/mynode/.mynode_bitcoind_synced"
# LND Variables
LND_WALLET_FILE = "/mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/wallet.db"
LND_DATA_FOLDER = "/mnt/hdd/mynode/lnd/data/"
# Other Variables
ELECTRS_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_electrs_enabled"
LNDHUB_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_lndhub_enabled"
BTCRPCEXPLORER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
VPN_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_vpn_enabled"

View File

@ -0,0 +1,4 @@
#!/bin/bash
source /usr/share/mynode/mynode_config.sh > /dev/null
echo $DEVICE_TYPE

View File

@ -1,8 +1,5 @@
CONFIG = {}
# Basic Config
CONFIG["device_type"] = "rock64"
# Enabled Features
CONFIG["rtl_enabled"] = True
CONFIG["electrs_enabled"] = True

View File

@ -48,7 +48,8 @@ def get_device_serial():
def get_device_type():
return CONFIG["device_type"]
device = subprocess.check_output("mynode-get-device-type", shell=True)
return device
def is_uploader():