diff options
author | Jeffery To <jeffery.to@gmail.com> | 2009-06-24 01:18:35 +0800 |
---|---|---|
committer | Jeffery To <jeffery.to@gmail.com> | 2009-06-24 01:18:35 +0800 |
commit | 65f784120b45dc187e28313fa2c2dca2c976c150 (patch) | |
tree | cf1cb3e34483466d4f4a312c528579292e7603fc /scripts/setup_status_network.sh | |
parent | f7d488d4b2bfdc8dfa6b5a2bc2931dbf824509a0 (diff) | |
parent | eb40fbc17ad1efb0a4c51ee00b1e9408d2af382f (diff) |
Merge branch '0.8.x' into notice-search-no-results
Diffstat (limited to 'scripts/setup_status_network.sh')
-rwxr-xr-x | scripts/setup_status_network.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/setup_status_network.sh b/scripts/setup_status_network.sh new file mode 100755 index 000000000..29ee010ed --- /dev/null +++ b/scripts/setup_status_network.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +source ./setup.cfg + +export nickname=$1 +export sitename=$2 + +export password=`$PWDGEN` +export database=$nickname$DBBASE +export username=$nickname$USERBASE + +# Create the db + +mysqladmin -h $DBHOST -u $ADMIN --password=$ADMINPASS create $database + +for f in laconica.sql innodb.sql sms_carrier.sql foreign_services.sql notice_source.sql; do + mysql -h $DBHOST -u $ADMIN --password=$ADMINPASS $database < ../db/$f; +done + +mysql -h $DBHOST -u $ADMIN --password=$ADMINPASS $SITEDB << ENDOFCOMMANDS + +GRANT INSERT,SELECT,UPDATE,DELETE ON $database.* TO '$username'@'localhost' IDENTIFIED BY '$password'; +GRANT INSERT,SELECT,UPDATE,DELETE ON $database.* TO '$username'@'%' IDENTIFIED BY '$password'; +INSERT INTO status_network (nickname, dbhost, dbuser, dbpass, dbname, sitename, created) +VALUES ('$nickname', '$DBHOST', '$username', '$password', '$database', '$sitename', now()); + +ENDOFCOMMANDS + +mkdir $AVATARBASE/$nickname +chmod a+w $AVATARBASE/$nickname |