Replaced more trouble substring lines.

Got the last of the negative indexed substrings, which caused problems
on some systems. Replaced with a more robust system.
This commit is contained in:
Marcus Whybrow 2012-06-25 13:00:51 +01:00
parent 472adc586b
commit 3e84582d5d

View File

@ -1839,11 +1839,11 @@ command_server_toggledownfall() {
regex="${LOG_REGEX} ${server_confirm_toggledownfall[$1]}"
if [[ "$line" =~ $regex ]]; then
echo "${line:36:(-3)}"
echo "${line:36:${#line}-3}"
fi
regex="${LOG_REGEX} ${server_confirm_toggledownfall_fail[$1]}"
if [[ "$line" =~ $regex ]]; then
echo "${line:34:(-3)}"
echo "${line:34:${#line}-3}"
fi
else
error_exit SERVER_STOPPED "Server \"${server_name[$1]}\" is not running."