proxmox_count: bash-lint
This commit is contained in:
parent
f2208bd01b
commit
abf6ed8ce5
1 changed files with 14 additions and 14 deletions
|
@ -11,18 +11,18 @@
|
||||||
# group root
|
# group root
|
||||||
|
|
||||||
# Pfade zu binaries
|
# Pfade zu binaries
|
||||||
wqm=$(which qm)
|
wqm=$(command -v qm)
|
||||||
wpct=$(which pct)
|
wpct=$(command -v pct)
|
||||||
# Berechne VMs
|
# Berechne VMs
|
||||||
total_vm=$($wqm list | sed 1d | wc -l)
|
total_vm=$($wqm list | sed 1d | wc -l)
|
||||||
running_vm=$($wqm list | sed 1d | grep running | wc -l)
|
running_vm=$($wqm list | sed 1d | grep -c running )
|
||||||
stopped_vm=$($wqm list | sed 1d | grep stopped | wc -l)
|
stopped_vm=$($wqm list | sed 1d | grep -c stopped )
|
||||||
# Berechne LXCs
|
# Berechne LXCs
|
||||||
total_lxc=$($wpct list | sed 1d | wc -l)
|
total_lxc=$($wpct list | sed 1d | wc -l)
|
||||||
running_lxc=$($wpct list | sed 1d | grep running | wc -l)
|
running_lxc=$($wpct list | sed 1d | grep -c running )
|
||||||
stopped_lxc=$($wpct list | sed 1d | grep stopped | wc -l)
|
stopped_lxc=$($wpct list | sed 1d | grep -c stopped )
|
||||||
# Berechne Gesamtwert
|
# Berechne Gesamtwert
|
||||||
total=$(($total_vm + $total_lxc))
|
total=$((total_vm + total_lxc))
|
||||||
|
|
||||||
# wenn parameter = ...
|
# wenn parameter = ...
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
|
@ -50,14 +50,14 @@ if [ "$1" = "config" ]; then
|
||||||
echo 'graph_args -l 0'
|
echo 'graph_args -l 0'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo total.value $total
|
echo total.value "$total"
|
||||||
|
|
||||||
echo total_vm.value $total_vm
|
echo total_vm.value "$total_vm"
|
||||||
echo total_lxc.value $total_lxc
|
echo total_lxc.value "$total_lxc"
|
||||||
|
|
||||||
echo running_vm.value $running_vm
|
echo running_vm.value "$running_vm"
|
||||||
echo running_lxc.value $running_lxc
|
echo running_lxc.value "$running_lxc"
|
||||||
|
|
||||||
echo stopped_vm.value $stopped_vm
|
echo stopped_vm.value "$stopped_vm"
|
||||||
echo stopped_lxc.value $stopped_lxc
|
echo stopped_lxc.value "$stopped_lxc"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue