mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
Check dir and conf only during restore
This commit is contained in:
parent
5713c40336
commit
41f07c5eab
2 changed files with 11 additions and 11 deletions
|
@ -35,17 +35,6 @@ pre_inst_haste() {
|
||||||
local TMPDIR=$(mktemp -d)
|
local TMPDIR=$(mktemp -d)
|
||||||
local HASTE_SOURCE=$1
|
local HASTE_SOURCE=$1
|
||||||
|
|
||||||
# Check destination directory
|
|
||||||
[[ -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."
|
|
||||||
|
|
||||||
haste_tarball="/tmp/haste.zip"
|
haste_tarball="/tmp/haste.zip"
|
||||||
rm -f "$haste_tarball"
|
rm -f "$haste_tarball"
|
||||||
if [ "$HASTE_SOURCE" = "backup" ]
|
if [ "$HASTE_SOURCE" = "backup" ]
|
||||||
|
|
|
@ -15,6 +15,17 @@ is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|| ynh_die "Path not available: ${domain}${path}"
|
||||||
|
|
||||||
|
# Check destination directory
|
||||||
|
[[ -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."
|
||||||
|
|
||||||
pre_inst_haste backup
|
pre_inst_haste backup
|
||||||
|
|
||||||
# Restore NGINX configuration
|
# Restore NGINX configuration
|
||||||
|
|
Loading…
Reference in a new issue