Push improvements form the PQB work
This commit is contained in:
parent
f3323b159b
commit
1e3c60630e
68 changed files with 409 additions and 219 deletions
40
_home/dot_sz.shrc.d/42_truecharts
Normal file
40
_home/dot_sz.shrc.d/42_truecharts
Normal file
|
@ -0,0 +1,40 @@
|
|||
[[ -r /etc/apt/sources.list ]] \
|
||||
&& ixsystems_system=$(cat /etc/apt/sources.list | grep '^deb https\?://apt\.tn\.ixsystems\.com' | wc -l) \
|
||||
&& [[ $ixsystems_system -lt 11 ]] \
|
||||
&& unset ixsystems_system
|
||||
|
||||
if [[ -n "$ixsystems_system" ]]; then
|
||||
if ! [[ -r /tmp/truenas_scriptpath ]]; then
|
||||
/sbin/zpool list -Ho name | \
|
||||
grep -v 'boot-pool' | \
|
||||
while read pool; do
|
||||
/sbin/zfs list -rHo name $pool | \
|
||||
grep "^$pool/[a-z\._]*data/_\?scripts"
|
||||
done | \
|
||||
while read dataset; do
|
||||
/sbin/zfs list -Ho mountpoint $dataset
|
||||
done > /tmp/truenas_scriptpath
|
||||
fi
|
||||
truenas_scriptspath=$(cat /tmp/truenas_scriptpath)
|
||||
fi
|
||||
|
||||
if [[ -n "$truenas_scriptspath" && -x "${truenas_scriptspath}/truetool/truetool.sh" ]]; then
|
||||
function truetool() {
|
||||
pushd ${truenas_scriptspath}/truetool > /dev/null
|
||||
sudo ./truetool.sh "${@}"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
function truedcx() {
|
||||
docker exec -it $(docker ps --filter "name=$1" -q) $2
|
||||
}
|
||||
function true-docker-id() {
|
||||
docker ps --filter "name=$1" -q
|
||||
}
|
||||
function true-hostname() {
|
||||
local ID=$(true-docker-id $1)
|
||||
local autoHostname=$(docker inspect --format="{{ .Config.Hostname }}" $ID)
|
||||
local contIP=$(docker exec $ID cat /etc/hosts | grep $autoHostname | awk '{print $1}')
|
||||
docker exec $ID nslookup $contIP | tail +4 | sed 's/^[0-9]\+.*name = [-0-9]\+\.//'
|
||||
}
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue