2022-10-10 12:21:17 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-10 08:13:18 +00:00
|
|
|
|
|
|
|
set -euo pipefail
|
2022-11-10 09:28:35 +00:00
|
|
|
shopt -s inherit_errexit
|
2022-08-10 08:13:18 +00:00
|
|
|
|
|
|
|
TO_DELETE=$(grep -lr "\"uid\": \"${1}\"" . || true)
|
2022-11-10 09:28:35 +00:00
|
|
|
if [[ -z "${TO_DELETE}" ]]
|
2022-08-10 08:13:18 +00:00
|
|
|
then
|
2022-11-10 09:28:35 +00:00
|
|
|
printf "Unable to find '%s'\n" "${1}"
|
2022-08-10 08:13:18 +00:00
|
|
|
else
|
|
|
|
printf "Statefile found. You should run:\n\n"
|
2022-11-10 09:28:35 +00:00
|
|
|
printf "cd %s\n" "${TO_DELETE}"
|
2022-10-31 15:58:35 +00:00
|
|
|
printf "constellation terminate --yes\n\n"
|
2022-08-10 08:13:18 +00:00
|
|
|
fi
|