diff --git a/_home/private_dot_config/sz.env/PATH_truestuff.env b/_home/private_dot_config/sz.env/PATH_truestuff.env index 88e9bea..bced20c 100644 --- a/_home/private_dot_config/sz.env/PATH_truestuff.env +++ b/_home/private_dot_config/sz.env/PATH_truestuff.env @@ -1,9 +1,14 @@ #!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"' -if is_truenas && is_cmd midclt && [ -z "$SCALE_POOL" ]; then +if is_cmd midclt; then export SCALE_POOL="$(midclt call "kubernetes.config" 2>/dev/null | jq -r '.pool')" + [ -n "$SCALE_POOL" ] && [ "$SCALE_POOL" != "null" ] || export SCALE_POOL="$(midclt call "pool.query" 2>/dev/null | jq -r '.[0].name')" [ -d "/mnt/$SCALE_POOL" ] || unset SCALE_POOL fi -[ -n "$SCALE_POOL" ] && export SCALE_POOL_ROOT=/mnt/$SCALE_POOL && export PATH="$SCALE_POOL_ROOT/_apps.data/_scripts/truestuff:$PATH" +[ -n "$SCALE_POOL" ] \ +&& export SCALE_POOL_ROOT=/mnt/$SCALE_POOL \ +&& PATH="$SCALE_POOL_ROOT/_apps.data/_scripts/truestuff:$PATH" \ +&& PATH="$SCALE_POOL_ROOT/data/scripts/truestuff:$PATH" \ +&& export PATH