Jump to content
Keith

[Release] ADI (Auto Database Installer) [Linux]

Recommended Posts

Hello everyone!

 

My name is Keith, I've been around the RO community since early 2003, it's been years since I've contributed to the community ...well since deving at eAthena..anyway.. today I'm releasing my script I created that installs the database for you, you can choose either pre-renewal or renewal, it's all up to you.

 

 

How do you use it?

 

It's simple!..just.. copy/paste the content from the URL below into a .sh file, make it a executable (chmod +x db-installer.sh) and run it (./db-installer.sh)

 

 

Download: https://gist.github.com/KeithGS/bc6a3220c488ae11f870

UPDATED: 06/18/14 4:20 CST

 

UPDATE: Now includes inserting log database into main database if you choose not to have a separate database for logs. 

 

UPDATE 2: Fixed some minor bugs.

 

UPDATE 3: Some spacing issues, and grammar fixes.

 

Picture in Action:

 

rhMadbl.png

 

Have any questions? Please let me know.

Edited by Keith

Share this post


Link to post
Share on other sites

Some Recoding for better view,

Instead of this:

# Base = renewalif [[ "$base" == "re" ]]; then        echo ""        echo "Lets get started.."        echo ""        echo "Inserting main.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sql        echo "Done inserting main.sql..."        echo ""        echo "Inserting item_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sql        echo "Done inserting item_db.sql."        echo ""        echo "Inserting item_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sql        echo "Done inserting item_db2.sql."        echo ""        echo "Inserting mob_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sql        echo "Done inserting mob_db.sql."        echo ""        echo "Inserting mob_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sql        echo "Done inserting mob_db2.sql."        echo ""        echo "Inserting mob_skill_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sql        echo "Done inserting mob_skill_db.sql."        echo ""        echo "Inserting mob_skill_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sql        echo "Done inserting mob_skill_db2.sql."        echo ""        echo "Inserting item_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db_re.sql        echo "Done inserting item_db_re.sql."        echo ""        #echo "Inserting item_db2_re.sql..."        #mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2_re.sql        #echo "Done inserting item_db2_re.sql."        #echo ""        echo "Inserting mob_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db_re.sql        echo "Done inserting mob_db_re.sql."        echo ""        echo "Inserting mob_skill_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db_re.sql        echo "Done inserting mob_skill_db_re.sql..."        echo ""        echo ""        echo "Finished inserting all renewal database sql files."fi # Base = 'pre-re'if [[ "$base" == "pre-re" ]]; then        echo ""        echo "Let's get started..."        echo ""        echo "Inserting main.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sql        echo "Done inserting main.sql.."        echo ""        echo "Inserting item_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sql        echo "Done inserting item_db.sql."        echo ""        echo "Inserting item_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sql        echo "Done inserting item_db2.sql."        echo ""        echo "Inserting mob_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sql        echo "Done inserting mob_db.sql."        echo ""        echo "Inserting mob_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sql        echo "Done inserting mob_db2.sql."        echo ""        echo "Inserting mob_skill_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sql        echo "Done inserting mob_skill_db.sql."        echo ""        echo "Inserting mob_skill_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sql        echo "Done inserting mob_skill_db2.sql."        echo ""        echo ""        echo "Finished inserting all pre-renewal database sql files."                # User didn't enter 'pre-re' or 're'elif [[ "$base" != "pre-re" ]] && [[ "$base" != "re" ]]; then        echo "ERROR: You didn't enter 're' or 'pre-re'"        exitfi

You can Use this:

# Base = renewalif [[ "$base" != "pre-re" ]] && [[ "$base" != "re" ]]; then        echo "ERROR: You didn't enter 're' or 'pre-re'"        exitfi#Common Databaseecho ""echo "Let's get started..."echo ""echo "Inserting main.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sqlecho "Done inserting main.sql.."echo ""echo "Inserting item_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sqlecho "Done inserting item_db.sql."echo ""echo "Inserting item_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sqlecho "Done inserting item_db2.sql."echo ""echo "Inserting mob_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sqlecho "Done inserting mob_db.sql."echo ""echo "Inserting mob_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sqlecho "Done inserting mob_db2.sql."echo ""echo "Inserting mob_skill_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sqlecho "Done inserting mob_skill_db.sql."echo ""echo "Inserting mob_skill_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sqlecho "Done inserting mob_skill_db2.sql."echo ""if [[ "$base" == "pre-re" ]]; then	#Pre-Renewal		echo ""        echo "Finished inserting all pre-renewal database sql files."elif [[ "$base" == "re" ]]; then	#Renewal        echo "Inserting item_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db_re.sql        echo "Done inserting item_db_re.sql."        echo ""        echo "Inserting mob_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db_re.sql        echo "Done inserting mob_db_re.sql."        echo ""        echo "Inserting mob_skill_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db_re.sql        echo "Done inserting mob_skill_db_re.sql..."        echo ""        echo ""        echo "Finished inserting all renewal database sql files."fi

Share this post


Link to post
Share on other sites

 

Some Recoding for better view,

Instead of this:

# Base = renewalif [[ "$base" == "re" ]]; then        echo ""        echo "Lets get started.."        echo ""        echo "Inserting main.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sql        echo "Done inserting main.sql..."        echo ""        echo "Inserting item_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sql        echo "Done inserting item_db.sql."        echo ""        echo "Inserting item_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sql        echo "Done inserting item_db2.sql."        echo ""        echo "Inserting mob_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sql        echo "Done inserting mob_db.sql."        echo ""        echo "Inserting mob_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sql        echo "Done inserting mob_db2.sql."        echo ""        echo "Inserting mob_skill_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sql        echo "Done inserting mob_skill_db.sql."        echo ""        echo "Inserting mob_skill_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sql        echo "Done inserting mob_skill_db2.sql."        echo ""        echo "Inserting item_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db_re.sql        echo "Done inserting item_db_re.sql."        echo ""        #echo "Inserting item_db2_re.sql..."        #mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2_re.sql        #echo "Done inserting item_db2_re.sql."        #echo ""        echo "Inserting mob_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db_re.sql        echo "Done inserting mob_db_re.sql."        echo ""        echo "Inserting mob_skill_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db_re.sql        echo "Done inserting mob_skill_db_re.sql..."        echo ""        echo ""        echo "Finished inserting all renewal database sql files."fi # Base = 'pre-re'if [[ "$base" == "pre-re" ]]; then        echo ""        echo "Let's get started..."        echo ""        echo "Inserting main.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sql        echo "Done inserting main.sql.."        echo ""        echo "Inserting item_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sql        echo "Done inserting item_db.sql."        echo ""        echo "Inserting item_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sql        echo "Done inserting item_db2.sql."        echo ""        echo "Inserting mob_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sql        echo "Done inserting mob_db.sql."        echo ""        echo "Inserting mob_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sql        echo "Done inserting mob_db2.sql."        echo ""        echo "Inserting mob_skill_db.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sql        echo "Done inserting mob_skill_db.sql."        echo ""        echo "Inserting mob_skill_db2.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sql        echo "Done inserting mob_skill_db2.sql."        echo ""        echo ""        echo "Finished inserting all pre-renewal database sql files."                # User didn't enter 'pre-re' or 're'elif [[ "$base" != "pre-re" ]] && [[ "$base" != "re" ]]; then        echo "ERROR: You didn't enter 're' or 'pre-re'"        exitfi

You can Use this:

# Base = renewalif [[ "$base" != "pre-re" ]] && [[ "$base" != "re" ]]; then        echo "ERROR: You didn't enter 're' or 'pre-re'"        exitfi#Common Databaseecho ""echo "Let's get started..."echo ""echo "Inserting main.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/main.sqlecho "Done inserting main.sql.."echo ""echo "Inserting item_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db.sqlecho "Done inserting item_db.sql."echo ""echo "Inserting item_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db2.sqlecho "Done inserting item_db2.sql."echo ""echo "Inserting mob_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db.sqlecho "Done inserting mob_db.sql."echo ""echo "Inserting mob_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db2.sqlecho "Done inserting mob_db2.sql."echo ""echo "Inserting mob_skill_db.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db.sqlecho "Done inserting mob_skill_db.sql."echo ""echo "Inserting mob_skill_db2.sql..."mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db2.sqlecho "Done inserting mob_skill_db2.sql."echo ""if [[ "$base" == "pre-re" ]]; then	#Pre-Renewal		echo ""        echo "Finished inserting all pre-renewal database sql files."elif [[ "$base" == "re" ]]; then	#Renewal        echo "Inserting item_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/item_db_re.sql        echo "Done inserting item_db_re.sql."        echo ""        echo "Inserting mob_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_db_re.sql        echo "Done inserting mob_db_re.sql."        echo ""        echo "Inserting mob_skill_db_re.sql..."        mysql -u "$username" -h"$hostname" -p"$password" "$database" < sql-files/mob_skill_db_re.sql        echo "Done inserting mob_skill_db_re.sql..."        echo ""        echo ""        echo "Finished inserting all renewal database sql files."fi

 

I was in a rush at the time, I've updated the script to fix some more spelling and cosmetic issues.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.