1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

[enh][WIP]remove deprecated initdb

This commit is contained in:
Clément 2016-09-04 12:04:50 +02:00
parent 63da94ea34
commit 117fd4864d

View file

@ -37,9 +37,9 @@ db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' |
app_salt=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{40\}\).*/\1/p') app_salt=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{40\}\).*/\1/p')
# Use 'freshrss' as database name and user # Use 'freshrss' as database name and user
db_user=freshrss db_user=freshrss
db_name=freshrss
# Initialize database and store mysql password for upgrade # Initialize database and store mysql password for upgrade
sudo yunohost app initdb $db_user -p $db_pwd ynh_mysql_create_db "$db_name" "$db_user" "$db_pwd"
sudo yunohost app setting freshrss mysqlpwd -v $db_pwd sudo yunohost app setting freshrss mysqlpwd -v $db_pwd
# Copy files to the right place # Copy files to the right place
@ -85,7 +85,9 @@ do
#change username in sql #change username in sql
sudo sed -i "s/YnoUser/$myuser/g" /tmp/$myuser-install.sql sudo sed -i "s/YnoUser/$myuser/g" /tmp/$myuser-install.sql
#create tables #create tables
mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" \
< "/tmp/$myuser-install.sql"
#remove temp sql #remove temp sql
sudo rm /tmp/$myuser-install.sql sudo rm /tmp/$myuser-install.sql
#copy default conf #copy default conf