Incus-Gitea/util/incus-remove-both.sh

16 lines
412 B
Bash
Executable File

#!/bin/bash
RUNNING_CONTAINERS="$(incus list -f compact -c n | sed 's/NAME//g' | sed 's/ //g' | awk 'NF')"
PROFILES="$(incus profile list -f csv | awk -F"," '{print $1}' | sed 's/default//g' | awk 'NF')"
for container in $RUNNING_CONTAINERS; do
echo "Removing $container..."
incus delete $container --force
done
for profile in $PROFILES; do
echo "Deleting $profile..."
incus profile delete $profile
done