1
1

Iterate over projects in show.sh

This commit is contained in:
Derek Smith 2023-03-23 14:25:31 -04:00
parent 2730bda32b
commit 3884c24e48
Signed by: farscapian
GPG Key ID: B443E530A14E1C90

View File

@ -1,13 +1,36 @@
#!/bin/bash #!/bin/bash
echo "LXD REMOTE: $(lxc remote get-default)" set -eu
cd "$(dirname "$0")"
lxc project list . ../defaults.sh
. ./remote_env.sh
echo "Global Settings:"
lxc image list
lxc storage list lxc storage list
lxc storage volume list ss-base lxc storage volume list ss-base
lxc image list
lxc project list echo
echo
for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
NO_PARENS="${PROJECT_CHAIN:1:${#PROJECT_CHAIN}-2}"
PROJECT_PREFIX=$(echo "$NO_PARENS" | cut -d'|' -f1)
BITCOIN_CHAIN=$(echo "$NO_PARENS" | cut -d'|' -f2)
PROJECT_NAME="$PROJECT_PREFIX-$BITCOIN_CHAIN"
if ! lxc info | grep "project:" | grep -q "$PROJECT_NAME"; then
if lxc project list | grep -q "$PROJECT_NAME"; then
lxc project switch "$PROJECT_NAME"
fi
fi
lxc network list lxc network list
lxc profile list lxc profile list
lxc list lxc list
done