2014-09-20 12:09:36 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
db_user=freshrss
|
|
|
|
db_name=freshrss
|
2015-02-09 21:50:00 +01:00
|
|
|
db_pwd=$(sudo cat /etc/yunohost/mysql)
|
2014-09-20 12:09:36 +02:00
|
|
|
app_path=/var/www/freshrss
|
|
|
|
|
|
|
|
myuser=$1
|
|
|
|
|
|
|
|
#copy sql
|
|
|
|
sudo cp $app_path/app/SQL/install_ynh.sql /tmp/$myuser-install.sql
|
|
|
|
#change username in sql
|
|
|
|
sudo sed -i "s/YnoUser/$myuser/g" /tmp/$myuser-install.sql
|
|
|
|
#create tables
|
|
|
|
mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql
|
|
|
|
#remove temp sql
|
|
|
|
sudo rm /tmp/$myuser-install.sql
|
|
|
|
#copy default conf
|
2015-02-09 18:08:17 +01:00
|
|
|
sudo cp -r $app_path/data/users/_ $app_path/data/users/$myuser/
|
|
|
|
sudo mv $app_path/data/users/$myuser/config.default.php $app_path/data/users/$myuser/config.php
|
2015-02-09 12:23:51 +01:00
|
|
|
sudo chown -R www-data: $app_path/data/users/$myuser/
|