mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +00:00
feat(sensor-proxy): improve turnkey setup experience with Pulse restart handling
- Update installer to use v4.32.0 Phase 2 binaries with file-based config - Add automatic detection of Pulse service (systemd/hot-dev/docker) - Add --restart-pulse flag for automatic Pulse restart in dev/test environments - Default behavior shows clear instructions to restart Pulse manually (safe for production) - Add prominent restart notice with command suggestions based on detected deployment - Improve UX by making restart step impossible to miss Related to Phase 2 sensor-proxy architecture improvements
This commit is contained in:
parent
5c2379b4b4
commit
497f94f4e8
1 changed files with 43 additions and 1 deletions
|
|
@ -993,7 +993,7 @@ EOF
|
|||
|
||||
# Parse arguments first to check for standalone mode
|
||||
CTID=""
|
||||
VERSION="latest"
|
||||
VERSION="v4.32.0"
|
||||
LOCAL_BINARY=""
|
||||
QUIET=false
|
||||
PULSE_SERVER=""
|
||||
|
|
@ -1002,6 +1002,7 @@ HTTP_MODE=false
|
|||
HTTP_ADDR=":8443"
|
||||
FALLBACK_BASE="${PULSE_SENSOR_PROXY_FALLBACK_URL:-}"
|
||||
SKIP_RESTART=false
|
||||
RESTART_PULSE=false
|
||||
UNINSTALL=false
|
||||
PURGE=false
|
||||
CONTROL_PLANE_TOKEN=""
|
||||
|
|
@ -1046,6 +1047,10 @@ while [[ $# -gt 0 ]]; do
|
|||
SKIP_RESTART=true
|
||||
shift
|
||||
;;
|
||||
--restart-pulse)
|
||||
RESTART_PULSE=true
|
||||
shift
|
||||
;;
|
||||
--uninstall)
|
||||
UNINSTALL=true
|
||||
shift
|
||||
|
|
@ -3272,6 +3277,43 @@ else
|
|||
echo ""
|
||||
fi
|
||||
|
||||
# Check if Pulse needs to be restarted to pick up the proxy registration
|
||||
PULSE_RESTART_CMD=""
|
||||
if systemctl is-active --quiet pulse 2>/dev/null; then
|
||||
PULSE_RESTART_CMD="systemctl restart pulse"
|
||||
elif systemctl is-active --quiet pulse-hot-dev 2>/dev/null; then
|
||||
PULSE_RESTART_CMD="systemctl restart pulse-hot-dev"
|
||||
elif command -v docker >/dev/null 2>&1 && docker ps --format '{{.Names}}' 2>/dev/null | grep -q '^pulse$'; then
|
||||
PULSE_RESTART_CMD="docker restart pulse"
|
||||
fi
|
||||
|
||||
if [[ -n "$PULSE_RESTART_CMD" ]]; then
|
||||
if [[ "$RESTART_PULSE" == true ]]; then
|
||||
echo ""
|
||||
print_info "Restarting Pulse to enable temperature monitoring..."
|
||||
if eval "$PULSE_RESTART_CMD"; then
|
||||
sleep 3
|
||||
print_success "Pulse restarted successfully - temperature monitoring is now active"
|
||||
else
|
||||
print_warn "Failed to restart Pulse automatically. Please restart manually:"
|
||||
echo " $PULSE_RESTART_CMD"
|
||||
fi
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo " Pulse Restart Required"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
print_info "${YELLOW}IMPORTANT:${NC} Restart Pulse to enable temperature monitoring:"
|
||||
echo " sudo $PULSE_RESTART_CMD"
|
||||
echo ""
|
||||
print_info "Or add --restart-pulse flag to restart automatically:"
|
||||
echo " curl ... | bash -s -- ... --restart-pulse"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
|
||||
print_info "To check proxy status:"
|
||||
print_info " systemctl status pulse-sensor-proxy"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue