Add --purge to reset.sh
This commit is contained in:
parent
9e7d9d3a90
commit
1fdf96bfa2
@ -10,7 +10,7 @@ if lxc remote get-default | grep -q "local"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "WARNING: This will DESTROY any existing VMs!"
|
echo "WARNING: This will DESTROY any existing VMs! Use the --purge flag to delete ALL Sovereign Stack LXD resources."
|
||||||
|
|
||||||
RESPONSE=
|
RESPONSE=
|
||||||
read -r -p "Are you sure you want to continue (y/n): ": RESPONSE
|
read -r -p "Are you sure you want to continue (y/n): ": RESPONSE
|
||||||
|
@ -4,6 +4,23 @@
|
|||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
|
||||||
|
PURGE_LXD=false
|
||||||
|
|
||||||
|
# grab any modifications from the command line.
|
||||||
|
for i in "$@"; do
|
||||||
|
case $i in
|
||||||
|
--purge)
|
||||||
|
PURGE_LXD=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unexpected option: $1"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
source ../defaults.sh
|
source ../defaults.sh
|
||||||
|
|
||||||
./destroy.sh
|
./destroy.sh
|
||||||
@ -27,6 +44,9 @@ if ! lxc info | grep -q "project: default"; then
|
|||||||
lxc project delete "$CURRENT_PROJECT"
|
lxc project delete "$CURRENT_PROJECT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$PURGE_LXD" = true ]; then
|
||||||
|
|
||||||
if lxc profile show default | grep -q "root:"; then
|
if lxc profile show default | grep -q "root:"; then
|
||||||
lxc profile device remove default root
|
lxc profile device remove default root
|
||||||
fi
|
fi
|
||||||
@ -63,3 +83,4 @@ if ! lxc remote get-default | grep -q "local"; then
|
|||||||
|
|
||||||
echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are now controlling your local instance."
|
echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are now controlling your local instance."
|
||||||
fi
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user