1
1
Fork 1

reset updates.

This commit is contained in:
Derek Smith 2023-10-20 13:56:51 -04:00
parent 3ade0537af
commit 651ee15224
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
1 changed files with 18 additions and 2 deletions

View File

@ -1,9 +1,15 @@
#!/bin/bash
set -e
set -eu
cd "$(dirname "$0")"
RESPONSE=
read -r -p "This is a VERY DANGEROUS COMMAND! Are you sure you want to continue? (y/n)": RESPONSE
if [ "$RESPONSE" != "y" ]; then
exit 1
fi
PURGE_LXD=false
# grab any modifications from the command line.
@ -46,6 +52,16 @@ fi
if [ "$PURGE_LXD" = true ]; then
# purge all projects
PROJECT_NAMES=$(lxc project list --format csv -q | grep -vw default | cut -d',' -f1)
# Iterate over each project name
for PROJECT in $PROJECT_NAMES; do
if ! echo "$PROJECT" | grep -q default; then
lxc project delete "$PROJECT"
fi
done
if lxc profile show default | grep -q "root:"; then
lxc profile device remove default root
fi