TrueNAS SCALE path to work on wolfpack and kateryna

This commit is contained in:
Lockszmith (@wolfpack) 2024-12-03 08:21:37 -05:00
parent 63997d2285
commit f26c5b3cc2
1 changed files with 7 additions and 2 deletions

View File

@ -1,9 +1,14 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"' #!/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')" 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 [ -d "/mnt/$SCALE_POOL" ] || unset SCALE_POOL
fi 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