Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes broken installation script/Trovebox UI Setup issue which preven… #1577

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions documentation/guides/InstallationUbuntuApache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,66 @@ else
IP=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
fi

echo ""
echo ""
echo "===================================================="
echo "Generating required database/User table"
echo "===================================================="
echo ""
echo ""

echo "Enter your mysql database name"
read DATABASE_NAME
echo "Attempting to create"
DBFAIL=false
mysql -u root -t -p -e "CREATE DATABASE $DATABASE_NAME;" 2>&1 >/dev/null | grep -i error && \
echo "Error try again." && \
mysql -u root -t -p -e "CREATE DATABASE $DATABASE_NAME;" 2>&1 >/dev/null | grep -i error && \
echo "Error try again." && \
mysql -u root -t -p -e "CREATE DATABASE $DATABASE_NAME;" 2>&1 >/dev/null | grep -i error && DBFAIL=true

if [ $DBFAIL == true ]; then
echo ""
echo ""
echo "Error if root password is incorrect Rerun script or manually configure DB with the below sql after you have configured your password, If db exists, rerun with new dbname" && \
echo ""
echo ""
echo "CREATE TABLE IF NOT EXISTS user (
id varchar(255) NOT NULL COMMENT 'Users email address',
password varchar(64) NOT NULL,
extra text NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"

else

echo ""
echo ""
echo "Created $DATABASE_NAME, Now creating user table"
echo ""
echo ""
echo "Generating user table"
echo ""
echo ""
mysql -u root -t -p $DATABASE_NAME << SQL
CREATE TABLE IF NOT EXISTS user (
id varchar(255) NOT NULL COMMENT 'Users email address',
password varchar(64) NOT NULL,
extra text NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SQL
if [ $? -eq 0 ];then
echo ""
echo ""
echo "DB created, User table created"
fi
fi
echo ""
echo ""

echo ""
echo ""
echo ""
Expand Down