Update lxc-mount-manager_minimal.sh

This commit is contained in:
MacRimi
2026-06-02 17:49:37 +02:00
parent 5a116e77b9
commit f27b3d480a

View File

@@ -851,8 +851,14 @@ $(translate "Proceed")?"
fi fi
echo "" echo ""
# Step 10: Offer restart # Step 10: Offer restart (only meaningful when the container is
# already running — `pct reboot` errors out on a stopped CT, and
# a stopped CT will pick up the new mount the next time it boots
# without any action on our side).
local ct_status
ct_status=$(pct status "$container_id" 2>/dev/null | awk '{print $2}')
echo "" echo ""
if [[ "$ct_status" == "running" ]]; then
if whiptail --yesno "$(translate "Restart container to activate mount?")" 8 60; then if whiptail --yesno "$(translate "Restart container to activate mount?")" 8 60; then
msg_info "$(translate "Restarting container...")" msg_info "$(translate "Restarting container...")"
if pct reboot "$container_id"; then if pct reboot "$container_id"; then
@@ -860,7 +866,6 @@ $(translate "Proceed")?"
msg_ok "$(translate "Container restarted successfully")" msg_ok "$(translate "Container restarted successfully")"
# Quick access test (read-only, no files written) # Quick access test (read-only, no files written)
local ct_status
ct_status=$(pct status "$container_id" 2>/dev/null | awk '{print $2}') ct_status=$(pct status "$container_id" 2>/dev/null | awk '{print $2}')
if [[ "$ct_status" == "running" ]]; then if [[ "$ct_status" == "running" ]]; then
echo "" echo ""
@@ -874,6 +879,9 @@ $(translate "Proceed")?"
msg_warn "$(translate "Failed to restart — restart manually to activate mount")" msg_warn "$(translate "Failed to restart — restart manually to activate mount")"
fi fi
fi fi
else
msg_info "$(translate "Container is stopped — mount will activate automatically on next start")"
fi
echo "" echo ""
msg_success "$(translate "Press Enter to continue...")" msg_success "$(translate "Press Enter to continue...")"