reset updates.
This commit is contained in:
parent
5689f97c4d
commit
65400e1dbd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue