1
1

Add remote/project checks on uninstall.sh

This commit is contained in:
Derek Smith 2023-04-14 13:16:41 -04:00
parent e762d05828
commit 6e6c55e801
Signed by: farscapian
GPG Key ID: B443E530A14E1C90

View File

@ -24,6 +24,21 @@ if ! command -v lxc >/dev/null 2>&1; then
exit 1 exit 1
fi fi
if ! lxc remote get-default | grep -q "local"; then
echo "ERROR: You MUST be on the local remote when uninstalling the SSME."
echo "INFO: You can use 'lxc remote switch local' to do this."
exit 1
fi
if ! lxc project list | grep -q "default (current)"; then
echo "ERROR: You MUST be on the default project when uninstalling the SSME."
echo "INFO: You can use 'lxc project switch default' to do this."
exit 1
fi
if lxc list --format csv | grep -q "ss-mgmt"; then if lxc list --format csv | grep -q "ss-mgmt"; then
if lxc list --format csv -q | grep -q "ss-mgmt,RUNNING"; then if lxc list --format csv -q | grep -q "ss-mgmt,RUNNING"; then