From 3e84582d5df1bd9aff3acf37d88a521cc8c61c57 Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Mon, 25 Jun 2012 13:00:51 +0100 Subject: [PATCH] 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. --- init/msm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/msm b/init/msm index ff3ed30..7edab36 100755 --- a/init/msm +++ b/init/msm @@ -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."