Update switch_from_VED_to_VE.sh

This commit is contained in:
CanbiZ 2025-03-12 11:44:37 +01:00
parent 6aa006c8a0
commit 46f6b27750

View File

@ -99,8 +99,8 @@ function remove_dev_tag() {
container=$1 container=$1
current_tags=$(pct config "$container" | awk '/^tags/ {print $2}') current_tags=$(pct config "$container" | awk '/^tags/ {print $2}')
if [[ "$current_tags" == *"dev"* ]]; then if [[ "$current_tags" == *"community-script-dev"* ]]; then
new_tags=$(echo "$current_tags" | sed 's/,*dev,*//g' | sed 's/^,//' | sed 's/,$//') new_tags=$(echo "$current_tags" | sed 's/,*community-script-dev,*//g' | sed 's/^,//' | sed 's/,$//')
if [[ -z "$new_tags" ]]; then if [[ -z "$new_tags" ]]; then
pct set "$container" -delete tags pct set "$container" -delete tags
@ -108,12 +108,12 @@ function remove_dev_tag() {
pct set "$container" -tags "$new_tags" pct set "$container" -tags "$new_tags"
fi fi
echo -e "${GN}[Success]${CL} 'dev' tag removed from ${BL}$container${CL}.\n" echo -e "${GN}[Success]${CL} 'community-script-dev' tag removed from ${BL}$container${CL}.\n"
fi fi
} }
header_info header_info
echo "Searching for containers with 'dev' tag..." echo "Searching for containers with 'community-script-dev' tag..."
for container in $(pct list | awk '{if(NR>1) print $1}'); do for container in $(pct list | awk '{if(NR>1) print $1}'); do
tags=$(pct config "$container" | awk '/^tags/ {print $2}') tags=$(pct config "$container" | awk '/^tags/ {print $2}')
if [[ "$tags" == *"dev"* ]]; then if [[ "$tags" == *"dev"* ]]; then