mirror of
https://github.com/YunoHost-Apps/roundcube_ynh.git
synced 2024-09-03 20:16:28 +02:00
[fix] Update nclean error code
This commit is contained in:
parent
2d3edbe943
commit
3da90e0fbb
3 changed files with 2 additions and 66 deletions
|
@ -42,8 +42,7 @@ grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \
|
ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control
|
||||||
|| ynh_die "Unable to install dependencies"
|
|
||||||
|
|
||||||
# Create system user dedicace for this app
|
# Create system user dedicace for this app
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
|
@ -76,64 +76,3 @@ sudo cp -a ./conf/php-fpm.ini "${phpfpm_ini}"
|
||||||
sudo systemctl reload php5-fpm
|
sudo systemctl reload php5-fpm
|
||||||
sudo systemctl reload nginx
|
sudo systemctl reload nginx
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Exit on command errors and treat unset variables as an error
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# Get multi-instances specific variables
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
# Set app specific variables
|
|
||||||
dbname=$app
|
|
||||||
dbuser=$app
|
|
||||||
|
|
||||||
# Source app helpers
|
|
||||||
. /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
# Retrieve old app settings
|
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
|
||||||
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
||||||
|
|
||||||
# Check domain/path availability
|
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
|
||||||
|| exit 1
|
|
||||||
|
|
||||||
# Check destination directory
|
|
||||||
DESTDIR="/var/www/$app"
|
|
||||||
[[ -d $DESTDIR ]] && ynh_die \
|
|
||||||
"The destination directory '$DESTDIR' already exists.\
|
|
||||||
You should safely delete it before restoring this app."
|
|
||||||
|
|
||||||
# Check configuration files
|
|
||||||
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
||||||
[[ -f $nginx_conf ]] && ynh_die \
|
|
||||||
"The NGINX configuration already exists at '${nginx_conf}'.
|
|
||||||
You should safely delete it before restoring this app."
|
|
||||||
phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf"
|
|
||||||
[[ -f $phpfpm_conf ]] && ynh_die \
|
|
||||||
"The PHP FPM configuration already exists at '${phpfpm_conf}'.
|
|
||||||
You should safely delete it before restoring this app."
|
|
||||||
|
|
||||||
# Restore the app files
|
|
||||||
sudo cp -a ./sources "$DESTDIR"
|
|
||||||
|
|
||||||
# Create and restore the database
|
|
||||||
ynh_mysql_create_db $dbname $dbuser $dbpass
|
|
||||||
ynh_mysql_connect_as $dbuser $dbpass $dbname < ./dump.sql
|
|
||||||
|
|
||||||
# Fix installation directories and permissions
|
|
||||||
sudo mkdir -p "${DESTDIR}/logs" "${DESTDIR}/temp"
|
|
||||||
sudo chown -R $app: "$DESTDIR"
|
|
||||||
|
|
||||||
# Restore configuration files
|
|
||||||
sudo cp -a ./nginx.conf "$nginx_conf"
|
|
||||||
sudo cp -a ./php-fpm.conf "$phpfpm_conf"
|
|
||||||
|
|
||||||
# Reload services
|
|
||||||
sudo service php5-fpm restart || true
|
|
||||||
sudo service nginx reload || true
|
|
||||||
|
|
|
@ -57,9 +57,7 @@ sudo chown -R admin: "${final_path}"
|
||||||
init_composer "${final_path}"
|
init_composer "${final_path}"
|
||||||
|
|
||||||
# Install the new Roundcube version
|
# Install the new Roundcube version
|
||||||
sudo php "${TMPDIR}/bin/installto.sh" "$DESTDIR" --force --accept \
|
sudo php "${final_path}/bin/installto.sh" "$final_path" --force --accept
|
||||||
|| ynh_die "Unable to update Roundcube installation"
|
|
||||||
rm -rf "$TMPDIR"
|
|
||||||
|
|
||||||
# Generate a new random DES key
|
# Generate a new random DES key
|
||||||
deskey=$(ynh_string_random 24)
|
deskey=$(ynh_string_random 24)
|
||||||
|
|
Loading…
Add table
Reference in a new issue