fix start after upgrade

This commit is contained in:
shocknet-justin 2025-08-31 00:16:41 -04:00
parent 31e5775f5c
commit fb6faf07f0
2 changed files with 20 additions and 13 deletions

View file

@ -47,8 +47,17 @@ log "Script version $SCRIPT_VERSION"
# Parse args for branch override # Parse args for branch override
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--branch) BRANCH="$2"; shift 2 ;; --branch=*)
*) shift ;; BRANCH="${1#*=}"
shift
;;
--branch)
BRANCH="$2"
shift 2
;;
*)
shift
;;
esac esac
done done

View file

@ -56,23 +56,21 @@ start_services() {
fi fi
# Always attempt to start or restart Lightning.Pub # Always attempt to start or restart Lightning.Pub
if $SYSTEMCTL_CMD is-active --quiet lightning_pub; then
if [ "$PUB_UPGRADE" = "100" ]; then if [ "$PUB_UPGRADE" = "100" ]; then
log "${PRIMARY_COLOR}Restarting${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} service..." log "${PRIMARY_COLOR}Restarting${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} service after upgrade..."
$SYSTEMCTL_CMD restart lightning_pub $SYSTEMCTL_CMD restart lightning_pub
else elif [ "$PUB_UPGRADE" = "0" ]; then
log "${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} service is already running."
fi
else
log "${PRIMARY_COLOR}Starting${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} service..." log "${PRIMARY_COLOR}Starting${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} service..."
$SYSTEMCTL_CMD start lightning_pub $SYSTEMCTL_CMD start lightning_pub
fi fi
# Check Lightning.Pub status after attempting to start/restart # Check Lightning.Pub status after attempting to start/restart
if [ "$PUB_UPGRADE" = "0" ] || [ "$PUB_UPGRADE" = "100" ]; then
if ! $SYSTEMCTL_CMD is-active --quiet lightning_pub; then if ! $SYSTEMCTL_CMD is-active --quiet lightning_pub; then
log "Failed to start or restart ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}. Please check the logs." log "Failed to start or restart ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}. Please check the logs."
exit 1 exit 1
fi fi
fi
else else
log "systemctl not available. Please start the services manually (e.g., run lnd and npm start in separate terminals)." log "systemctl not available. Please start the services manually (e.g., run lnd and npm start in separate terminals)."