DieFeM 12 лет назад
Родитель
Сommit
56fbb60693
1 измененных файлов с 29 добавлено и 31 удалено
  1. 29 31
      agent_conf.sh

+ 29 - 31
agent_conf.sh

@@ -43,7 +43,6 @@ bashprefsfile=${agent_home}/Cfg/bash_prefs.cfg
 overwrite_config=1
 overwrite_config=1
 
 
 if [ -z "$opType" ]; then
 if [ -z "$opType" ]; then
-
 	if [ -e ${cfgfile} ]; then
 	if [ -e ${cfgfile} ]; then
 		while [ 1 ]
 		while [ 1 ]
 		do
 		do
@@ -62,7 +61,6 @@ if [ -z "$opType" ]; then
 			fi
 			fi
 		done
 		done
 	fi
 	fi
-
 else
 else
 	overwrite_config=0
 	overwrite_config=0
 fi
 fi
@@ -75,35 +73,35 @@ then
 	echo "Enter a string of alpha-numeric characters for example 'abcd12345'"
 	echo "Enter a string of alpha-numeric characters for example 'abcd12345'"
 	echo "**** NOTE - Use the same key in your Open Game Panel webpage config file - they must match *****"
 	echo "**** NOTE - Use the same key in your Open Game Panel webpage config file - they must match *****"
 	echo ""
 	echo ""
-	
+
 	while [ -z "${key}" ]
 	while [ -z "${key}" ]
 	do 
 	do 
 		echo -n "Set encryption key: "
 		echo -n "Set encryption key: "
 		read key
 		read key
 	done
 	done
-	
+
 	echo
 	echo
 	echo "Set the listen port for the agent. The default should be fine for everyone."
 	echo "Set the listen port for the agent. The default should be fine for everyone."
 	echo "However, if you want to change it that can be done here, otherwise just press Enter."
 	echo "However, if you want to change it that can be done here, otherwise just press Enter."
 	echo -n "Set listen port [Default ${DEFAULT_PORT}]: "
 	echo -n "Set listen port [Default ${DEFAULT_PORT}]: "
 	read port
 	read port
-	
+
 	if [ -z "${port}" ]
 	if [ -z "${port}" ]
 	then 
 	then 
 		port=$DEFAULT_PORT
 		port=$DEFAULT_PORT
 	fi
 	fi
-	
+
 	echo 
 	echo 
 	echo "Set the listen IP for the agent."
 	echo "Set the listen IP for the agent."
 	echo "Use ${DEFAULT_IP} to bind on all interfaces."
 	echo "Use ${DEFAULT_IP} to bind on all interfaces."
 	echo -n "Set listen IP [Default ${DEFAULT_IP}]: "
 	echo -n "Set listen IP [Default ${DEFAULT_IP}]: "
 	read ip
 	read ip
-	
+
 	if [ -z "${ip}" ]  
 	if [ -z "${ip}" ]  
 	then 
 	then 
 		ip=$DEFAULT_IP
 		ip=$DEFAULT_IP
 	fi 
 	fi 
-	
+
 	while [ 1 ]
 	while [ 1 ]
 	do
 	do
 		echo
 		echo
@@ -122,9 +120,9 @@ then
 		
 		
 		echo "You need to type either 'Accept' or 'Reject'.";
 		echo "You need to type either 'Accept' or 'Reject'.";
 	done
 	done
-	
+
 	echo "Writing Config file - $cfgfile"
 	echo "Writing Config file - $cfgfile"
-	
+
 	echo "%Cfg::Config = (
 	echo "%Cfg::Config = (
 	logfile => '${agent_home}/ogp_agent.log',
 	logfile => '${agent_home}/ogp_agent.log',
 	listen_port  => '${port}',
 	listen_port  => '${port}',
@@ -139,7 +137,7 @@ then
 	then
 	then
 		failed "Failed to write config file."
 		failed "Failed to write config file."
 	fi 
 	fi 
-	
+
 	echo;
 	echo;
 	while [ 1 ]
 	while [ 1 ]
 	do
 	do
@@ -161,7 +159,7 @@ then
 		fi
 		fi
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 	done
 	done
-	
+
 	echo;
 	echo;
 	while [ 1 ]
 	while [ 1 ]
 	do
 	do
@@ -183,8 +181,8 @@ then
 		fi
 		fi
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 	done
 	done
-	
-	echo;	
+
+	echo;
 	echo "After how many days should be deleted the old backups of server's logs?"
 	echo "After how many days should be deleted the old backups of server's logs?"
 	echo -n "[Default 30]: "
 	echo -n "[Default 30]: "
 	read delete_logs_after
 	read delete_logs_after
@@ -192,7 +190,7 @@ then
 		''|*[!0-9]*) deleteLogsAfter=30 ;;
 		''|*[!0-9]*) deleteLogsAfter=30 ;;
 		*) deleteLogsAfter=${delete_logs_after} ;;
 		*) deleteLogsAfter=${delete_logs_after} ;;
 	esac
 	esac
-    
+
 	echo;
 	echo;
 	while [ 1 ]
 	while [ 1 ]
 	do
 	do
@@ -214,7 +212,7 @@ then
 		fi
 		fi
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 		echo "You need to type 'yes', 'no' or leave empty for default value [yes].";
 	done
 	done
-	
+
 	echo;
 	echo;
 	echo "What mirror you want to use for updating the agent?: "
 	echo "What mirror you want to use for updating the agent?: "
 	echo;
 	echo;
@@ -274,7 +272,7 @@ then
 		*) mirror="master"
 		*) mirror="master"
 		;;
 		;;
 	esac
 	esac
-	
+
 	if [ "$(uname -o)" != "Cygwin" ]; then
 	if [ "$(uname -o)" != "Cygwin" ]; then
 		echo;
 		echo;
 		while [ 1 ]
 		while [ 1 ]
@@ -399,22 +397,22 @@ then
 	else
 	else
 		ftpMethod="PureFTPd"
 		ftpMethod="PureFTPd"
 	fi
 	fi
-	
+
 	echo "Writing Preferences file - $prefsfile"
 	echo "Writing Preferences file - $prefsfile"
-	
+
 	echo "%Cfg::Preferences = (
 	echo "%Cfg::Preferences = (
-    	screen_log_local => '${logLocalCopy}',
-    	delete_logs_after => '${deleteLogsAfter}',
-    	ogp_manages_ftp => '${ogpManagesFTP}',
-    	ftp_method => '${ftpMethod}',
-    	ogp_autorestart_server => '${autoRestart}',
-    	);" > $prefsfile 
-	
-    	if [ $? != 0 ]
-    	then
-        	failed "Failed to write preferences file."
-    	fi
-    
+		screen_log_local => '${logLocalCopy}',
+		delete_logs_after => '${deleteLogsAfter}',
+		ogp_manages_ftp => '${ogpManagesFTP}',
+		ftp_method => '${ftpMethod}',
+		ogp_autorestart_server => '${autoRestart}',
+		);" > $prefsfile 
+
+		if [ $? != 0 ]
+		then
+			failed "Failed to write preferences file."
+		fi
+
 	echo "Writing bash script preferences file - $bashprefsfile"
 	echo "Writing bash script preferences file - $bashprefsfile"
 	
 	
 	echo -e "agent_auto_update=${autoUpdate}\nsf_update_mirror=${mirror}" > $bashprefsfile
 	echo -e "agent_auto_update=${autoUpdate}\nsf_update_mirror=${mirror}" > $bashprefsfile