2022-01-27 10:08:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
check_controller()
|
|
|
|
{
|
|
|
|
controller=$1
|
2024-09-30 09:19:55 +00:00
|
|
|
model="cpe-jammy"
|
2022-01-27 10:08:00 +00:00
|
|
|
|
2024-09-30 09:19:55 +00:00
|
|
|
juju status -m "${controller}":${model} --color | grep "Unit " -A 999999 | grep -E -v "started.*ubuntu@|active.*idle"
|
2022-01-27 10:08:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ -z "$1" ]] ; then
|
2023-02-22 14:16:27 +00:00
|
|
|
check_controller "$(juju controllers --format json | jq -r .\"current-controller\")"
|
2022-01-27 10:08:00 +00:00
|
|
|
else
|
2023-02-22 14:16:27 +00:00
|
|
|
check_controller "${1}"
|
2022-01-27 10:08:00 +00:00
|
|
|
fi
|
|
|
|
|