zfs_count: bash lint
This commit is contained in:
parent
eeaaedadf0
commit
e79510f163
1 changed files with 6 additions and 6 deletions
12
zfs_count
12
zfs_count
|
@ -19,8 +19,8 @@ if [ "$1" = "config" ]; then
|
|||
# https://superuser.com/questions/284187/bash-iterating-over-lines-in-a-variable
|
||||
while read -r line; do
|
||||
# setze label <pool>.label <pool> snapshots
|
||||
echo $line | awk '{print $1"_snapshot.label " $1 " snapshots"}'
|
||||
echo $line | awk '{print $1"_dataset.label " $1 " datasets"}'
|
||||
echo "$line" | awk '{print $1"_snapshot.label " $1 " snapshots"}'
|
||||
echo "$line" | awk '{print $1"_dataset.label " $1 " datasets"}'
|
||||
done <<< "$list_pools"
|
||||
echo 'pools.label pools'
|
||||
# setze optionen
|
||||
|
@ -35,11 +35,11 @@ fi
|
|||
# tue für jede Zeile
|
||||
# "echo" die Zeile, wende awk drauf, Spalte $1/$7
|
||||
while read -r line; do
|
||||
echo pools.value $(zpool list | sed 1d | wc -l)
|
||||
echo pools.value "$(zpool list | sed 1d | wc -l)"
|
||||
# setze poolnamen
|
||||
poolname=$(echo $line | awk '{ print $1 }')
|
||||
poolname=$(echo "$line" | awk '{ print $1 }')
|
||||
# zähle snapshots
|
||||
echo $poolname"_snapshot.value" $(zfs list -r -t snapshot $poolname| sed 1d | wc -l)
|
||||
echo $poolname"_dataset.value" $(zfs list -r $poolname| sed 1d | wc -l)
|
||||
echo "$poolname""_snapshot.value" "$(zfs list -r -t snapshot "$poolname" | sed 1d | wc -l)"
|
||||
echo "$poolname""_dataset.value" "$(zfs list -r "$poolname" | sed 1d | wc -l)"
|
||||
done <<< "$list_pools"
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue