mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-30 14:05:59 +00:00
fix(pve-privilege-converter): handle already stopped container in manage_states (#12765)
This commit is contained in:
@@ -134,6 +134,7 @@ manage_states() {
|
|||||||
read -rp "Shutdown source and start new container? [Y/n]: " answer
|
read -rp "Shutdown source and start new container? [Y/n]: " answer
|
||||||
answer=${answer:-Y}
|
answer=${answer:-Y}
|
||||||
if [[ $answer =~ ^[Yy] ]]; then
|
if [[ $answer =~ ^[Yy] ]]; then
|
||||||
|
if pct status "$CONTAINER_ID" | grep -q running; then
|
||||||
pct shutdown "$CONTAINER_ID"
|
pct shutdown "$CONTAINER_ID"
|
||||||
for i in {1..36}; do
|
for i in {1..36}; do
|
||||||
sleep 5
|
sleep 5
|
||||||
@@ -145,6 +146,9 @@ manage_states() {
|
|||||||
pkill -9 -f "lxc-start -F -n $CONTAINER_ID"
|
pkill -9 -f "lxc-start -F -n $CONTAINER_ID"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
msg_custom "ℹ️" "\e[36m" "Source container $CONTAINER_ID is already stopped"
|
||||||
|
fi
|
||||||
pct start "$NEW_CONTAINER_ID"
|
pct start "$NEW_CONTAINER_ID"
|
||||||
msg_ok "New container started"
|
msg_ok "New container started"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user