fix: automatically restart container when proxy mount is configured
Instead of warning the user to restart the container manually, the script now automatically restarts it when the socket mount configuration is updated. This ensures the mount is immediately active and temperature monitoring works right away without user intervention. Uses 'pct restart' if running, 'pct start' if stopped.
This commit is contained in:
parent
d3c2a01140
commit
171723a7d3
1 changed files with 3 additions and 5 deletions
|
|
@ -801,15 +801,13 @@ fi
|
|||
|
||||
# Restart container to apply mount if configuration changed or mount missing
|
||||
if [[ "$MOUNT_UPDATED" = true ]]; then
|
||||
print_info "Restarting container to apply socket mount..."
|
||||
if [[ "$CT_RUNNING" = true ]]; then
|
||||
print_warn "Container $CTID is currently running. Restart it when convenient to activate the secure proxy mount."
|
||||
pct restart "$CTID"
|
||||
else
|
||||
print_info "Restarting container to apply socket mount..."
|
||||
pct stop "$CTID" || true
|
||||
sleep 2
|
||||
pct start "$CTID"
|
||||
sleep 5
|
||||
fi
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Verify socket directory and file inside container
|
||||
|
|
|
|||
Loading…
Reference in a new issue