2021-03-19 19:47:11 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
2023-11-25 15:13:16 +01:00
#REMOVEME? ynh_abort_if_errors
2021-03-19 19:47:11 +01:00
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2023-11-25 15:13:16 +01:00
#REMOVEME? app_id=$YNH_APP_ARG_APP_ID
#REMOVEME? sub_folder=$YNH_APP_ARG_SUB_FOLDER
2021-03-19 19:47:11 +01:00
2023-11-25 15:13:16 +01:00
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
2021-03-19 19:47:11 +01:00
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
2023-11-25 15:13:16 +01:00
#REMOVEME? ynh_script_progression --message="Validating installation parameters..."
2021-03-19 19:47:11 +01:00
2023-11-25 15:13:16 +01:00
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app_id --key=install_dir)$sub_folder/icecoder
#REMOVEME? #REMOVEME? test -e "$(ynh_app_setting_get --app=$app_id --key=install_dir)" || ynh_die --message="You don't have installed $app_id before installing this app"
#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
2021-03-19 19:47:11 +01:00
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
2023-11-25 15:13:16 +01:00
#REMOVEME? ynh_script_progression --message="Storing installation settings..."
2021-03-19 19:47:11 +01:00
2022-03-27 00:20:46 +01:00
ynh_app_setting_set --app=$app --key=app_id --value=$app_id
2022-03-26 13:57:24 +01:00
ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder
2021-03-19 19:47:11 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2022-03-24 21:01:11 +01:00
ynh_script_progression --message="Setting up source files..."
2021-03-19 19:47:11 +01:00
2023-11-25 15:13:16 +01:00
#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
2021-03-19 19:47:11 +01:00
# Download, check integrity, uncompress and patch the source from app.src
2023-11-25 15:13:16 +01:00
ynh_setup_source --dest_dir="$install_dir"
2021-03-29 18:57:36 +02:00
2023-11-25 15:13:16 +01:00
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app_id:www-data "$install_dir"
2022-03-27 00:20:46 +01:00
2021-03-19 19:47:11 +01:00
#=================================================
# GENERIC FINALIZATION
#=================================================
# END OF SCRIPT
#=================================================
2022-03-24 21:01:11 +01:00
ynh_script_progression --message="Installation of $app completed"