urls
This commit is contained in:
parent
02d2ab1ee7
commit
597470cb9d
2 changed files with 9 additions and 3 deletions
|
|
@ -13,6 +13,8 @@ log() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SCRIPT_VERSION="0.1.0"
|
SCRIPT_VERSION="0.1.0"
|
||||||
|
REPO_URL="https://github.com/shocknet/Lightning.Pub/tarball/master"
|
||||||
|
BASE_URL="https://raw.githubusercontent.com/shocknet/Lightning.Pub/master/scripts/"
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
echo "Cleaning up temporary files..."
|
echo "Cleaning up temporary files..."
|
||||||
|
|
@ -27,7 +29,6 @@ log_error() {
|
||||||
exit $2
|
exit $2
|
||||||
}
|
}
|
||||||
|
|
||||||
BASE_URL="https://raw.githubusercontent.com/shocknet/Lightning.Pub/master/scripts/"
|
|
||||||
|
|
||||||
modules=(
|
modules=(
|
||||||
"utils"
|
"utils"
|
||||||
|
|
@ -75,7 +76,7 @@ else
|
||||||
|
|
||||||
install_nodejs || log_error "Failed to install Node.js" 1
|
install_nodejs || log_error "Failed to install Node.js" 1
|
||||||
|
|
||||||
install_lightning_pub || log_error "Failed to install Lightning.Pub" 1
|
install_lightning_pub "$REPO_URL" || log_error "Failed to install Lightning.Pub" 1
|
||||||
|
|
||||||
log "Starting services..."
|
log "Starting services..."
|
||||||
start_services $lnd_status $pub_upgrade_status || log_error "Failed to start services" 1
|
start_services $lnd_status $pub_upgrade_status || log_error "Failed to start services" 1
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
install_lightning_pub() {
|
install_lightning_pub() {
|
||||||
|
local REPO_URL="$1"
|
||||||
local upgrade_status=0
|
local upgrade_status=0
|
||||||
|
|
||||||
|
if [ -z "$REPO_URL" ]; then
|
||||||
|
log "REPO_URL missing"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$EUID" -eq 0 ]; then
|
if [ "$EUID" -eq 0 ]; then
|
||||||
USER_HOME=$(getent passwd ${SUDO_USER} | cut -d: -f6)
|
USER_HOME=$(getent passwd ${SUDO_USER} | cut -d: -f6)
|
||||||
USER_NAME=$SUDO_USER
|
USER_NAME=$SUDO_USER
|
||||||
|
|
@ -35,7 +41,6 @@ install_lightning_pub() {
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}..."
|
log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}..."
|
||||||
REPO_URL="https://github.com/shocknet/Lightning.Pub/tarball/master"
|
|
||||||
|
|
||||||
sudo -u $USER_NAME wget -q $REPO_URL -O $USER_HOME/lightning_pub.tar.gz > /dev/null 2>&1 || {
|
sudo -u $USER_NAME wget -q $REPO_URL -O $USER_HOME/lightning_pub.tar.gz > /dev/null 2>&1 || {
|
||||||
log "${PRIMARY_COLOR}Failed to download Lightning.Pub.${RESET_COLOR}"
|
log "${PRIMARY_COLOR}Failed to download Lightning.Pub.${RESET_COLOR}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue