You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
698 B

11 years ago
#!/bin/sh
##
## phabricator-setup
##
# determine MySQL root password
db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
# dispatch operation
cmd="${1:-"install"}"
case "$cmd" in
install )
# create the database
@l_prefix@/sbin/phabricator-storage upgrade --force --user "$db_suser" --password "$db_spass"
;;
uninstall )
# remove the database
( echo "DROP DATABASE $db_name;"
) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
;;
esac