mirror of
https://github.com/YunoHost-Apps/ghost_ynh.git
synced 2024-09-03 19:16:02 +02:00
Fix in update script
This commit is contained in:
parent
2c66727718
commit
fa069c9c54
1 changed files with 9 additions and 7 deletions
|
@ -41,11 +41,6 @@ if [ -z $db_name ]; then
|
||||||
ynh_app_setting_set $app db_name $db_name
|
ynh_app_setting_set $app db_name $db_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
|
||||||
if [ -z $final_path ]; then
|
|
||||||
final_path=/var/www/$app
|
|
||||||
ynh_app_setting_set $app final_path $final_path
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
@ -77,9 +72,15 @@ path_url=$(ynh_normalize_url_path $path_url)
|
||||||
tmpdir="$(mktemp -d)"
|
tmpdir="$(mktemp -d)"
|
||||||
# Backup the content folder to the temp dir
|
# Backup the content folder to the temp dir
|
||||||
cp -ar "$final_path/content" "$tmpdir"
|
cp -ar "$final_path/content" "$tmpdir"
|
||||||
sudo rm -R "$tmpdir"
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
|
# Download, uncompress and patch the source
|
||||||
|
sudo rm -R "$final_path"
|
||||||
|
# If final_path doesn't exist, create it
|
||||||
|
if [ -z $final_path ]; then
|
||||||
|
final_path=/var/www/$app
|
||||||
|
ynh_app_setting_set $app final_path $final_path
|
||||||
|
fi
|
||||||
tmpdir1="$(mktemp -d)"
|
tmpdir1="$(mktemp -d)"
|
||||||
sudo wget -O "$tmpdir1/ghost.zip" "https://ghost.org/zip/ghost-latest.zip"
|
sudo wget -O "$tmpdir1/ghost.zip" "https://ghost.org/zip/ghost-latest.zip"
|
||||||
unzip "$tmpdir1/ghost.zip" -d "$final_path"
|
unzip "$tmpdir1/ghost.zip" -d "$final_path"
|
||||||
|
@ -87,6 +88,7 @@ sudo rm -R "$tmpdir1/ghost.zip"
|
||||||
|
|
||||||
# copy content folder back to the final_path
|
# copy content folder back to the final_path
|
||||||
sudo cp -ar "$tmpdir/content" "${final_path}"
|
sudo cp -ar "$tmpdir/content" "${final_path}"
|
||||||
|
sudo rm -R "$tmpdir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
|
Loading…
Add table
Reference in a new issue