1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ampache_ynh.git synced 2024-09-03 18:15:55 +02:00
ampache_ynh/scripts/upgrade
2018-01-11 22:10:06 +01:00

87 lines
2.3 KiB
Bash

#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path)
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
admin_ampache=$(ynh_app_setting_get $app admin)
#=================================================
# CHECK THE PATH
#=================================================
path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
# Get sources and copy files to the right place
ampache_ynh_getsources
# Change variables in Ampache configuration
ampache_ynh_prepareconfig
#=================================================
# NGINX CONFIGURATION
#=================================================
# Modify Nginx configuration file and copy it to Nginx conf directory
if [ "$path_url" != "/" ]
then
ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf"
fi
ynh_add_nginx_config
#=================================================
# INSTALL DEPENDENCIES
#=================================================
# Install dependency
ynh_install_app_dependencies libav-tools
#=================================================
# SPECIFIC SETUP
#=================================================
# Ampache installation
ampache_ynh_install
#=================================================
# RELOAD SSOWAT
#=================================================
# Regenerate SSOwat conf
ampache_ynh_reloadservices
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
# Pre config ampache
ampache_ynh_doconfig
#=================================================
# CLEANING
#=================================================
# Clean install
ynh_secure_remove ../ampache-$version