From 6e6c55e8011d9d3e03cd4872d7294b5c98ffca17 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 14 Apr 2023 13:16:41 -0400 Subject: [PATCH] Add remote/project checks on uninstall.sh --- uninstall.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/uninstall.sh b/uninstall.sh index ed77907..d1a754e 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -24,6 +24,21 @@ if ! command -v lxc >/dev/null 2>&1; then exit 1 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 -q | grep -q "ss-mgmt,RUNNING"; then