1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
This commit is contained in:
polytan02 2017-02-21 22:23:45 +00:00
parent f57a8ab64c
commit f3bb7a61e8
5 changed files with 26 additions and 26 deletions

View file

@ -9,7 +9,7 @@
dbuser=$app
# Source app helpers
. /usr/share/yunohost/helpers
source /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
@ -22,9 +22,9 @@
# Copy the conf files
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
# Copy dedicated php-fpm process to backup folder
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" "php-fpm.conf"
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
# Dump the database
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql

View file

@ -55,7 +55,7 @@
sudo gpg --batch --delete-key --yes Rainloop
# Unzip
sudo unzip -qq rainloop-community-${rainloop_version}.zip -d $rainloop_path/
# Install plugins
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
sudo cp -rf ../sources/plugins/auto-domain-grab $rainloop_path/data/_data_/_default_/plugins/.
@ -78,7 +78,7 @@
lang="en"
esac
ynh_app_setting_set "$app" lang "$lang"
# Set plugins
plugins="auto-domain-grab" # This plugin is trying to automatically grab unknown domains if users want to add external email accounts
if [ "$ldap" = "Yes" ];
@ -86,7 +86,7 @@
plugins="$plugins,ynh-ldap-suggestions" # This plugin is to suggest YunoHost users in recipients list
fi
ynh_app_setting_set "$app" plugins "$plugins"
sudo cp ../conf/data/configs/application.ini $application_file
sudo sed -i "s@domain.tld@$domain@g" $application_file
sudo sed -i "s@MYSQLUSER@$dbuser@g" $application_file
@ -144,5 +144,5 @@
fi
# Reload services
sudo service php5-fpm restart || true
sudo service php5-fpm reload || true
sudo service nginx reload || true

View file

@ -5,25 +5,25 @@
app=$YNH_APP_INSTANCE_NAME
# Source app helpers
. /usr/share/yunohost/helpers
source /usr/share/yunohost/helpers
# Retrieve arguments
dbuser=$app
dbname=$app
domain=$(ynh_app_setting_get "$app" domain)
dbuser=$app
dbname=$app
domain=$(ynh_app_setting_get "$app" domain)
# Drop MySQL database and user
ynh_mysql_drop_db "$dbname" 2>&1 || true
ynh_mysql_drop_user "$dbuser" 2>&1 || true
ynh_mysql_drop_db "$dbname" 2>&1 || true
ynh_mysql_drop_user "$dbuser" 2>&1 || true
# Delete app directory and configurations
sudo rm -rf "/var/www/${app}"
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
sudo rm -rf "/var/www/${app}"
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Remove GPG key
sudo gpg --batch --delete-key --yes Rainloop
sudo gpg --batch --delete-key --yes Rainloop
# Reload services
sudo service php5-fpm restart || true
sudo service nginx reload || true
sudo service php5-fpm reload || true
sudo service nginx reload || true

View file

@ -1,13 +1,13 @@
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
set -eu
# Get multi-instances specific variables
app=$YNH_APP_INSTANCE_NAME
# Source app helpers
. /usr/share/yunohost/helpers
source /usr/share/yunohost/helpers
# Retrieve old app settings
domain=$(ynh_app_setting_get "$app" domain)
@ -52,5 +52,5 @@ set -eu
sudo cp -a ./php-fpm.conf "$phpfpm_conf"
# Reload services
sudo service php5-fpm restart || true
sudo service php5-fpm reload || true
sudo service nginx reload || true

View file

@ -17,11 +17,11 @@
sudo yunohost backup restore --ignore-hooks $app-before-upgrade --apps $app --force --quiet # Restore the backup if upgrade failed
ynh_die "Upgrade failed. The app was restored to the way it was before the failed upgrade."
}
set -eu
set -eu
trap EXIT_PROPERLY ERR
# Source app helpers
. /usr/share/yunohost/helpers
source /usr/share/yunohost/helpers
# Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain)
@ -53,7 +53,7 @@
sudo wget -q https://github.com/RainLoop/rainloop-webmail/releases/download/v${rainloop_version}/rainloop-community-${rainloop_version}.zip
sudo wget -q https://github.com/RainLoop/rainloop-webmail/releases/download/v${rainloop_version}/rainloop-community-${rainloop_version}.zip.asc
sudo wget -q https://repository.rainloop.net/RainLoop.asc
# Verify the integrity of sources
# Verify the integrity of sources
sudo gpg --import --quiet RainLoop.asc
sudo gpg --verify --quiet rainloop-community-${rainloop_version}.zip.asc rainloop-community-${rainloop_version}.zip
sudo gpg --batch --delete-key --yes Rainloop
@ -95,5 +95,5 @@
sudo chmod 644 $finalphpconf
# Reload services
sudo service php5-fpm restart || true
sudo service php5-fpm reload || true
sudo service nginx reload || true