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"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.2-beta2
PROGRAM_BUILD=2016102303
PROGRAM_BUILD=2016102304
IS_STABLE=no
# Execution order #__WITH_PARANOIA_DEBUG
@ -268,7 +268,7 @@ function _CheckDiskSpaceLocal {
local replica_path="${1}"
__CheckArguments 1 $# "${FUNCNAME[0]}" "$@" #__WITH_PARANOIA_DEBUG
local disk_space
local diskSpace
local notation
local suffix
local suffixPresent
@ -276,15 +276,15 @@ function _CheckDiskSpaceLocal {
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
if [ $(IsInteger $disk_space) -eq 0 ]; then
disk_space=$(HumanToNumeric $disk_space)
if [ $(IsInteger $diskSpace) -eq 0 ]; then
diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $disk_space -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($disk_space KB)." "WARN"
if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($diskSpace KB)." "WARN"
fi
}
@ -295,7 +295,7 @@ function _CheckDiskSpaceRemote {
Logger "Checking remote minimum disk space in [$replica_path]." "NOTICE"
local cmd
local disk_space
local diskSpace
CheckConnectivity3rdPartyHosts
CheckConnectivityRemoteHost
@ -307,15 +307,15 @@ function _CheckDiskSpaceRemote {
Logger "Cannot get free space on target [$replica_path]." "ERROR"
Logger "Command output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID)" "NOTICE"
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
if [ $(IsInteger $disk_space) -eq 0 ]; then
disk_space=$(HumanToNumeric $disk_space)
if [ $(IsInteger $diskSpace) -eq 0 ]; then
diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $disk_space -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($disk_space KB)." "WARN"
if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on replica [$replica_path] ($diskSpace KB)." "WARN"
fi
fi
}