1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00

fixed a forgotten import of the script helper and removed sudo before helpers

This commit is contained in:
Pierre-Antoine Rault 2016-12-13 16:12:58 +01:00
parent d569748da5
commit 6d15a15a01
3 changed files with 16 additions and 10 deletions

View file

@ -21,11 +21,11 @@ db_user=ffsync
# 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 sudo yunohost app initdb $db_user -p $db_pwd
sudo ynh_app_setting_set ffsync mysqlpwd $db_pwd ynh_app_setting_set ffsync mysqlpwd $db_pwd
# Generate random password and save # Generate random password and save
secret=$(head -c 20 /dev/urandom | sha1sum | cut -d " " -f1) secret=$(head -c 20 /dev/urandom | sha1sum | cut -d " " -f1)
sudo ynh_app_setting_set ffsync secret $secret ynh_app_setting_set ffsync secret $secret
# Check depends installation # Check depends installation
sudo apt-get install make python-dev python-virtualenv -y sudo apt-get install make python-dev python-virtualenv -y
@ -96,4 +96,4 @@ sudo service ffsync restart
sudo yunohost app ssowatconf sudo yunohost app ssowatconf
sudo service nginx restart sudo service nginx restart
sudo yunohost service add ffsync -l /var/log/ffsync.log sudo yunohost service add ffsync -l /var/log/ffsync.log
sudo ynh_app_setting_set ffsync skipped_uris "/" ynh_app_setting_set ffsync skipped_uris "/"

View file

@ -1,9 +1,12 @@
#!/bin/bash #!/bin/bash
# Source app helpers
. /usr/share/yunohost/helpers
db_user=ffsync db_user=ffsync
db_name=ffsync db_name=ffsync
root_pwd=$(sudo cat /etc/yunohost/mysql) root_pwd=$(sudo cat /etc/yunohost/mysql)
domain=$(sudo ynh_app_setting_get ffsync domain) domain=$(ynh_app_setting_get ffsync domain)
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
sudo rm -rf /opt/yunohost/ffsync sudo rm -rf /opt/yunohost/ffsync

View file

@ -1,19 +1,22 @@
#!/bin/bash #!/bin/bash
# Source app helpers
. /usr/share/yunohost/helpers
# Retrieve arguments # Retrieve arguments
domain=$(sudo ynh_app_setting_get ffsync domain) domain=$(ynh_app_setting_get ffsync domain)
path=$(sudo ynh_app_setting_get ffsync path) path=$(ynh_app_setting_get ffsync path)
db_pwd=$(sudo ynh_app_setting_get ffsync mysqlpwd) db_pwd=$(ynh_app_setting_get ffsync mysqlpwd)
db_user=ffsync db_user=ffsync
final_path=/opt/yunohost/ffsync final_path=/opt/yunohost/ffsync
# Get secret variable # Get secret variable
secret=$(sudo ynh_app_setting_get ffsync secret) secret=$(ynh_app_setting_get ffsync secret)
# Get from conf file if not defined # Get from conf file if not defined
if [[ -z $secret ]] if [[ -z $secret ]]
then then
secret=$(sudo grep "secret =" $final_path/syncserver.ini | cut -d" " -f3) secret=$(sudo grep "secret =" $final_path/syncserver.ini | cut -d" " -f3)
sudo ynh_app_setting_set ffsync secret $secret ynh_app_setting_set ffsync secret $secret
fi fi
# Check Swap # Check Swap
@ -81,5 +84,5 @@ sudo service ffsync restart
# Reload Nginx and regenerate SSOwat conf # Reload Nginx and regenerate SSOwat conf
sudo service nginx reload sudo service nginx reload
sudo ynh_app_setting_set ffsync skipped_uris "/" ynh_app_setting_set ffsync skipped_uris "/"
sudo yunohost app ssowatconf sudo yunohost app ssowatconf