mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-11 11:06:24 +00:00
Update lxc-mount-manager_minimal.sh
This commit is contained in:
@@ -851,28 +851,36 @@ $(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 whiptail --yesno "$(translate "Restart container to activate mount?")" 8 60; then
|
if [[ "$ct_status" == "running" ]]; then
|
||||||
msg_info "$(translate "Restarting container...")"
|
if whiptail --yesno "$(translate "Restart container to activate mount?")" 8 60; then
|
||||||
if pct reboot "$container_id"; then
|
msg_info "$(translate "Restarting container...")"
|
||||||
sleep 5
|
if pct reboot "$container_id"; then
|
||||||
msg_ok "$(translate "Container restarted successfully")"
|
sleep 5
|
||||||
|
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 ""
|
if pct exec "$container_id" -- test -d "$ct_mount_point" 2>/dev/null; then
|
||||||
if pct exec "$container_id" -- test -d "$ct_mount_point" 2>/dev/null; then
|
msg_ok "$(translate "Mount point is accessible inside container")"
|
||||||
msg_ok "$(translate "Mount point is accessible inside container")"
|
else
|
||||||
else
|
msg_warn "$(translate "Mount point not yet accessible — may need manual permission adjustment")"
|
||||||
msg_warn "$(translate "Mount point not yet accessible — may need manual permission adjustment")"
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
msg_warn "$(translate "Failed to restart — restart manually to activate mount")"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
msg_warn "$(translate "Failed to restart — restart manually to activate mount")"
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
msg_info "$(translate "Container is stopped — mount will activate automatically on next start")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user