Преглед изворни кода

fix error with"UNKNOWN" value instead of digit

If the server (such as TS3) doesn't required glibc, the glibc needed version is UNKNOWN. That was breaking the command as it expected an numeric value.
See https://github.com/dgibbs64/linuxgsm/blob/master/functions/info_glibc.sh#L63 to understand.
UltimateByte пре 10 година
родитељ
комит
95afe04aea
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      functions/command_details.sh

+ 1 - 1
functions/command_details.sh

@@ -145,7 +145,7 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mUser:\t\e[0m$(whoami)"
 	echo -e "\e[34mUser:\t\e[0m$(whoami)"
 
 
 	# GLIBC required
 	# GLIBC required
-	if [ -n "${glibcrequired}" ]; then
+	if [ -n "${glibcrequired}" ] && [ "${glibcrequired}" != "UNKNOWN" ]; then
 		if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then
 		if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then
 			if [ "${glibcfix}" == "yes" ]; then
 			if [ "${glibcfix}" == "yes" ]; then
 				echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"
 				echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"