1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-31 13:23:42 +00:00

quake plugins: fix shellcheck issues

This commit is contained in:
Lars Kruse 2018-03-09 05:25:13 +01:00
parent ba66ff7490
commit 8fa7e61b43
3 changed files with 39 additions and 43 deletions

View file

@ -13,7 +13,7 @@ qstat_exe='/usr/local/bin/qstat'
#---------------------------------------------------------------#
# End of config
script_name=$(basename $0)
script_name=$(basename "$0")
#################################################################
#################################################################
@ -29,9 +29,9 @@ usage() {
config() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
gametype=$(echo "$script_name" | cut -d_ -f2)
ip=$(echo "$script_name" | cut -d_ -f3)
port=$(echo "$script_name" | cut -d_ -f4)
else
gametype=$1
ip=$2
@ -51,20 +51,20 @@ player.label players"
#---------------------------------------------------------------#
quake_stat() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
gametype=$(echo "$script_name" | cut -d_ -f2)
ip=$(echo "$script_name" | cut -d_ -f3)
port=$(echo "$script_name" | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
if [ ! -z ${gametype} ] && [ ! -z ${gametype} ] && [ ! -z ${gametype} ]; then
dummy=$(${qstat_exe} -raw ";" -nh -${gametype} ${ip}:${port})
if [ ! -z "$gametype" ] && [ ! -z "$gametype" ] && [ ! -z "$gametype" ]; then
dummy=$("$qstat_exe" -raw ";" -nh "-$gametype" "${ip}:${port}")
playervalue=$(echo ${dummy} | cut -d\; -f6)
maxplayervalue=$(echo ${dummy} | cut -d\; -f5)
playervalue=$(echo "$dummy" | cut -d\; -f6)
maxplayervalue=$(echo "$dummy" | cut -d\; -f5)
if [ -z "${playervalue}" ]; then
playervalue=0
@ -88,7 +88,7 @@ quake_stat() {
#---------------------------------------------------------------#
case $1 in
config)
config
config "$@"
exit 0
;;
help | ?)
@ -99,7 +99,7 @@ case $1 in
echo "no (edit the script for set qstat path)"
;;
*)
quake_stat $1 $2 $3
quake_stat "$@"
exit 0
;;
esac