1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/icecoder_ynh.git synced 2024-09-03 19:26:10 +02:00
icecoder_ynh/scripts/install

65 lines
2.3 KiB
Text
Raw Normal View History

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
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2021-03-29 19:02:14 +02:00
app_id=$YNH_APP_ARG_APP_ID
2022-03-26 13:57:24 +01:00
sub_folder=$YNH_APP_ARG_SUB_FOLDER
2021-03-19 19:47:11 +01:00
2021-03-20 07:08:56 +01:00
app=$YNH_APP_INSTANCE_NAME
2021-03-19 19:47:11 +01:00
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
2022-03-24 21:01:11 +01:00
ynh_script_progression --message="Validating installation parameters..."
2021-03-19 19:47:11 +01:00
2022-03-26 13:57:24 +01:00
final_path=$(ynh_app_setting_get --app=$app_id --key=final_path)$sub_folder/icecoder
test -e "$(ynh_app_setting_get --app=$app_id --key=final_path)" || ynh_die --message="You don't have installed $app before installing this app"
2021-03-19 19:47:11 +01:00
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
2022-03-24 21:01:11 +01:00
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
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
2021-03-29 18:57:36 +02:00
ynh_setup_source --dest_dir="$final_path"
2022-03-24 21:01:11 +01:00
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app_id:www-data "$final_path"
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"