Permalink
Browse files

Replaced tabs by spaces in linux_installer.sh

  • Loading branch information...
1 parent c695ad6 commit 9f0b93320ada9a11b0219bbbb74fa87c9ffe2c70 thumsoul committed Nov 5, 2011
Showing with 108 additions and 108 deletions.
  1. +108 −108 linux_installer.sh
View
@@ -31,8 +31,8 @@ bkpath="dump"
#
############################################################################
if [ ! -d "${bkpath}" ]; then
- mkdir "${bkpath}"
- chmod 0755 "${bkpath}"
+ mkdir "${bkpath}"
+ chmod 0755 "${bkpath}"
fi
############################################################################
@@ -41,118 +41,118 @@ fi
#
############################################################################
until [ "${option}" = "x" ]; do
- logo
- echo " i - Install Clean World Database"
- echo " u - Update World Database"
- echo " x - Exit Tool"
- echo
- read -p " Enter option: " option
- if [ "${option}" = "i" ]; then
+ logo
+ echo " i - Install Clean World Database"
+ echo " u - Update World Database"
+ echo " x - Exit Tool"
+ echo
+ read -p " Enter option: " option
+ if [ "${option}" = "i" ]; then
- mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${wdb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb}
- echo
+ mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${wdb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb}
+ echo
- echo
- echo " [Cleaning World DB] Finished..."
-
- echo " Adding Stored Procedures"
- max=`ls -1 "${procpath}"/*.sql | wc -l`
- e=0
- for table in "${procpath}"/*.sql; do
- e=$((${i}+1))
- echo " [${e}/${max}] import: ${table##*/}"
- mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${table}"
+ echo
+ echo " [Cleaning World DB] Finished..."
+
+ echo " Adding Stored Procedures"
+ max=`ls -1 "${procpath}"/*.sql | wc -l`
+ e=0
+ for table in "${procpath}"/*.sql; do
+ e=$((${i}+1))
+ echo " [${e}/${max}] import: ${table##*/}"
+ mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${table}"
+ done
+ echo " Adding Adding Stored Procedures Complete"
+ echo " Importing world data"
+ max=`ls -1 "${devpath}"/*.sql | wc -l`
+ i=0
+ for table in "${devpath}"/*.sql; do
+ i=$((${i}+1))
+ echo " [${i}/${max}] import: ${table##*/}"
+ mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${table}"
done
- echo " Adding Adding Stored Procedures Complete"
- echo " Importing world data"
- max=`ls -1 "${devpath}"/*.sql | wc -l`
- i=0
- for table in "${devpath}"/*.sql; do
- i=$((${i}+1))
- echo " [${i}/${max}] import: ${table##*/}"
- mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${table}"
- done
- echo
- echo " [Importing] Finished..."
- elif [ "${option}" = "b" ]; then
-
- echo
- rm -rf "${bkpath}/logon_backup.sql"
- rm -rf "${bkpath}/character_backup.sql"
- echo " [Deleting Old Backups] Finished..."
-
- echo
- mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb} > "${bkpath}/logon_backup.sql"
- echo " [Backing Up Logon Database] Finished..."
-
- mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb} > "${bkpath}/character_backup.sql"
- echo " [Backing Up Char Database] Finished..."
-
- echo
- echo " [Backing Up] Finished..."
- elif [ "${option}" = "r" ]; then
-
- echo
- mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${ldb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb}
- echo " [Emptying Logon Database] Finished..."
-
- mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb} < "${bkpath}/logon_backup.sql"
- echo " [Restoring Logon Database From Backup] Finished..."
-
- echo
- mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${cdb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb}
- echo " [Emptying Char Database] Finished..."
-
- mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb} < "${bkpath}/character_backup.sql"
- echo " [Restoring Char Database From Backup] Finished..."
-
- echo
- echo " [Restoring Backup] Finished..."
+ echo
+ echo " [Importing] Finished..."
+ elif [ "${option}" = "b" ]; then
+
+ echo
+ rm -rf "${bkpath}/logon_backup.sql"
+ rm -rf "${bkpath}/character_backup.sql"
+ echo " [Deleting Old Backups] Finished..."
+
+ echo
+ mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb} > "${bkpath}/logon_backup.sql"
+ echo " [Backing Up Logon Database] Finished..."
+
+ mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb} > "${bkpath}/character_backup.sql"
+ echo " [Backing Up Char Database] Finished..."
+
+ echo
+ echo " [Backing Up] Finished..."
+ elif [ "${option}" = "r" ]; then
+
+ echo
+ mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${ldb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb}
+ echo " [Emptying Logon Database] Finished..."
+
+ mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${ldb} < "${bkpath}/logon_backup.sql"
+ echo " [Restoring Logon Database From Backup] Finished..."
+
+ echo
+ mysqldump -h ${server} --user=${user} --port=${port} --password=${pass} --add-drop-table --no-data ${cdb} | grep ^DROP | mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb}
+ echo " [Emptying Char Database] Finished..."
+
+ mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${cdb} < "${bkpath}/character_backup.sql"
+ echo " [Restoring Char Database From Backup] Finished..."
+
+ echo
+ echo " [Restoring Backup] Finished..."
- elif [ "${option}" = "u" ]; then
-
- available_changesets=("${uppath}/changeset_"*.sql)
- if [ "${available_changesets}" != "${uppath}/changeset_*.sql" ]; then
+ elif [ "${option}" = "u" ]; then
+
+ available_changesets=("${uppath}/changeset_"*.sql)
+ if [ "${available_changesets}" != "${uppath}/changeset_*.sql" ]; then
- echo
- echo " Here's a list of available updates:"
- echo
- for changeset in ${available_changesets[@]};
- do
- echo " ${changeset##*/}"
- done
-
- echo
- read -p " Which update would you like to import (type x to abort): " index
- if [ "${index}" != "x" ]; then
- update="${uppath}/changeset_${index}.sql"
- if [ ! -f "${update}" ]; then
- echo
- echo " ${update} file does not exist."
- else
- echo
- echo " Importing changeset ${index}."
- mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${update}"
- echo
- echo " [Updating World Database] Finished..."
- fi
- fi
-
- else
+ echo
+ echo " Here's a list of available updates:"
+ echo
+ for changeset in ${available_changesets[@]};
+ do
+ echo " ${changeset##*/}"
+ done
+
+ echo
+ read -p " Which update would you like to import (type x to abort): " index
+ if [ "${index}" != "x" ]; then
+ update="${uppath}/changeset_${index}.sql"
+ if [ ! -f "${update}" ]; then
+ echo
+ echo " ${update} file does not exist."
+ else
+ echo
+ echo " Importing changeset ${index}."
+ mysql -h ${server} --user=${user} --port=${port} --password=${pass} ${wdb} < "${update}"
+ echo
+ echo " [Updating World Database] Finished..."
+ fi
+ fi
+
+ else
- echo
- echo " Currently, no updates are available."
+ echo
+ echo " Currently, no updates are available."
- fi
- elif [ "${option}" != "x" ]; then
- echo
- read -p " Incorrect option '${option}'."
- echo
- fi
- if [ "${option}" != "x" ]; then
- echo
- read -p " Press any key to continue..."
- echo
- fi
+ fi
+ elif [ "${option}" != "x" ]; then
+ echo
+ read -p " Incorrect option '${option}'."
+ echo
+ fi
+ if [ "${option}" != "x" ]; then
+ echo
+ read -p " Press any key to continue..."
+ echo
+ fi
done

0 comments on commit 9f0b933

Please sign in to comment.