Code compliance

This commit is contained in:
deajan 2016-10-23 13:28:28 +02:00
parent 0e897f66c5
commit 06d2171a31
1 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2016 by Orsiris de Jong" AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.2-beta2 PROGRAM_VERSION=1.2-beta2
PROGRAM_BUILD=2016102303 PROGRAM_BUILD=2016102304
IS_STABLE=no IS_STABLE=no
# Execution order #__WITH_PARANOIA_DEBUG # Execution order #__WITH_PARANOIA_DEBUG
@ -268,7 +268,7 @@ function _CheckDiskSpaceLocal {
local replica_path="${1}" local replica_path="${1}"
__CheckArguments 1 $# "${FUNCNAME[0]}" "$@" #__WITH_PARANOIA_DEBUG __CheckArguments 1 $# "${FUNCNAME[0]}" "$@" #__WITH_PARANOIA_DEBUG
local disk_space local diskSpace
local notation local notation
local suffix local suffix
local suffixPresent local suffixPresent
@ -276,15 +276,15 @@ function _CheckDiskSpaceLocal {
Logger "Checking minimum disk space in [$replica_path]." "NOTICE" Logger "Checking minimum disk space in [$replica_path]." "NOTICE"
disk_space=$(df "$replica_path" | tail -1 | awk '{print $4}') diskSpace=$(df "$replica_path" | tail -1 | awk '{print $4}')
# Ugly fix for df in some busybox environments that can only show human formats # Ugly fix for df in some busybox environments that can only show human formats
if [ $(IsInteger $disk_space) -eq 0 ]; then if [ $(IsInteger $diskSpace) -eq 0 ]; then
disk_space=$(HumanToNumeric $disk_space) diskSpace=$(HumanToNumeric $diskSpace)
fi fi
if [ $disk_space -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($disk_space KB)." "WARN" Logger "There is not enough free space on replica [$replica_path] ($diskSpace KB)." "WARN"
fi fi
} }
@ -295,7 +295,7 @@ function _CheckDiskSpaceRemote {
Logger "Checking remote minimum disk space in [$replica_path]." "NOTICE" Logger "Checking remote minimum disk space in [$replica_path]." "NOTICE"
local cmd local cmd
local disk_space local diskSpace
CheckConnectivity3rdPartyHosts CheckConnectivity3rdPartyHosts
CheckConnectivityRemoteHost CheckConnectivityRemoteHost
@ -307,15 +307,15 @@ function _CheckDiskSpaceRemote {
Logger "Cannot get free space on target [$replica_path]." "ERROR" Logger "Cannot get free space on target [$replica_path]." "ERROR"
Logger "Command output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID)" "NOTICE" Logger "Command output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID)" "NOTICE"
else else
disk_space=$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID | tail -1 | awk '{print $4}') diskSpace=$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID | tail -1 | awk '{print $4}')
# Ugly fix for df in some busybox environments that can only show human formats # Ugly fix for df in some busybox environments that can only show human formats
if [ $(IsInteger $disk_space) -eq 0 ]; then if [ $(IsInteger $diskSpace) -eq 0 ]; then
disk_space=$(HumanToNumeric $disk_space) diskSpace=$(HumanToNumeric $diskSpace)
fi fi
if [ $disk_space -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($disk_space KB)." "WARN" Logger "There is not enough free space on replica [$replica_path] ($diskSpace KB)." "WARN"
fi fi
fi fi
} }