Explorar el Código

prevent error message in if

Daniel Gibbs hace 8 años
padre
commit
6c38a3c869
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lgsm/functions/install_config.sh

+ 1 - 1
lgsm/functions/install_config.sh

@@ -62,7 +62,7 @@ fn_set_config_vars(){
 		fn_script_log_info "changing hostname."
 		sleep 1
 
-		if [ $(grep SERVERNAME=SERVERNAME \"${lgsmdir}/config-default/config-game/${config}\") ]; then
+		if [ $(grep SERVERNAME=SERVERNAME \"${lgsmdir}/config-default/config-game/${config}\" 2>/dev/null) ]; then
 			sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
 		else
 			sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"