1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hat_ynh.git synced 2024-09-03 19:16:04 +02:00
This commit is contained in:
ericgaspar 2022-05-29 17:30:04 +02:00
parent 429a2c4987
commit 4618b85048
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 7 additions and 6 deletions

View file

@ -13,7 +13,7 @@
upgrade=1
#upgrade=1 from_commit=CommitHash
backup_restore=1
multi_instance=1
multi_instance=0
change_url=1
;;; Options
Email=

View file

@ -24,7 +24,7 @@
"requirements": {
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"multi_instance": false,
"services": [
"nginx"
],

View file

@ -12,13 +12,14 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK VERSION
@ -29,7 +30,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
@ -45,14 +46,14 @@ ynh_abort_if_errors
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"