Daniel Gibbs před 9 roky
rodič
revize
d95c630283
1 změnil soubory, kde provedl 11 přidání a 15 odebrání
  1. 11 15
      lgsm/functions/install_config.sh

+ 11 - 15
lgsm/functions/install_config.sh

@@ -42,33 +42,29 @@ fn_user_input_config(){
 	sleep 1
 	sleep 1
 }
 }
 
 
-# Copys the default config from remote repo
+# Copys the default configs from Game-Server-Configs repo to the
+# correct location
 fn_default_config_remote(){
 fn_default_config_remote(){
 	for config in "${array_configs[@]}"
 	for config in "${array_configs[@]}"
 	do
 	do
+		# every config is copied
 		echo "copying ${servercfg} config file."
 		echo "copying ${servercfg} config file."
 		fn_script_log_info "copying ${servercfg} config file."
 		fn_script_log_info "copying ${servercfg} config file."
-		cp -v "${lgsmdir}/default-configs/${config}" "${servercfgfullpath}"
+		if [ "${config}" == "${servercfgdefault}" ]; then
+			cp -v "${lgsmdir}/default-configs/${config}" "${servercfgfullpath}"
+		else
+			cp -v "${lgsmdir}/default-configs/${config}" "${servercfgdir}/${config}"
+		fi
 	done
 	done
+	# the main config is renamed to the script default
+	cp -v "${servercfgdefault}" "${servercfgfullpath}"
 	sleep 1
 	sleep 1
 }
 }
 
 
-# Copys the default config already available
-fn_default_config_local(){
-	for config in "${array_configs[@]}"
-	do
-		echo "copying ${servercfg} config file."
-		fn_script_log_info "copying ${servercfg} config file."
-		cp -v "${servercfgdefault}" "${servercfgfullpath}"
-	done
-	sleep 1
-}
-
-
 echo ""
 echo ""
 echo "Downloading ${gamename} Config"
 echo "Downloading ${gamename} Config"
 echo "================================="
 echo "================================="
-echo "Configs from https://github.com/GameServerManagers/Game-Server-Configs"
+echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs"
 sleep 2
 sleep 2
 if [ "${gamename}" == "7 Days To Die" ]; then
 if [ "${gamename}" == "7 Days To Die" ]; then
 	gamedirname="7DaysToDie"
 	gamedirname="7DaysToDie"