1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/radicale_ynh.git synced 2024-09-03 20:16:14 +02:00

Simplification

This commit is contained in:
yalh76 2022-03-20 14:04:52 +01:00
parent e3e0f0e0df
commit 9b92cf7ffb
2 changed files with 14 additions and 34 deletions

View file

@ -97,15 +97,8 @@ cp -a ../sources/extra_files_radicale/. "$final_path"
if [ $infcloud -eq 1 ] if [ $infcloud -eq 1 ]
then then
#Instal InfCloud
# Backup the content of $final_path
final_path_backup=$final_path
# Modify final_path for InfCloud installation
final_path=$final_path/infcloud
# Download and uncompress the source into final_path # Download and uncompress the source into final_path
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path/infcloud"
# Restore the content of $final_path
final_path=$final_path_backup
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"

View file

@ -85,46 +85,46 @@ if [ -z "$version" ]
then then
# Retrieve the version number in the manifest file. # Retrieve the version number in the manifest file.
version=$(ynh_app_upstream_version) version=$(ynh_app_upstream_version)
ynh_app_setting_set $app version "$version" ynh_app_setting_set --app=$app --key=version --value="$version"
fi fi
# Fix infcloud as a boolean # Fix infcloud as a boolean
if [ "$infcloud" = "Yes" ]; then if [ "$infcloud" = "Yes" ]; then
ynh_app_setting_set $app infcloud 1 ynh_app_setting_set --app=$app --key=infcloud --value=1
infcloud=1 infcloud=1
elif [ "$infcloud" = "No" ]; then elif [ "$infcloud" = "No" ]; then
ynh_app_setting_set $app infcloud 0 ynh_app_setting_set --app=$app --key=infcloud --value=0
infcloud=0 infcloud=0
fi fi
# If overwrite_logging doesn't exist, create it # If overwrite_logging doesn't exist, create it
if [ -z "$overwrite_logging" ]; then if [ -z "$overwrite_logging" ]; then
overwrite_logging=1 overwrite_logging=1
ynh_app_setting_set $app overwrite_logging $overwrite_logging ynh_app_setting_set --app=$app --key=overwrite_logging --value=$overwrite_logging
fi fi
# If overwrite_config doesn't exist, create it # If overwrite_config doesn't exist, create it
if [ -z "$overwrite_config" ]; then if [ -z "$overwrite_config" ]; then
overwrite_config=1 overwrite_config=1
ynh_app_setting_set $app overwrite_config $overwrite_config ynh_app_setting_set --app=$app --key=overwrite_config --value=$overwrite_config
fi fi
# If overwrite_infcloud doesn't exist, create it # If overwrite_infcloud doesn't exist, create it
if [ -z "$overwrite_infcloud" ]; then if [ -z "$overwrite_infcloud" ]; then
overwrite_infcloud=1 overwrite_infcloud=1
ynh_app_setting_set $app overwrite_infcloud $overwrite_infcloud ynh_app_setting_set --app=$app --key=overwrite_infcloud --value=$overwrite_infcloud
fi fi
# If overwrite_nginx doesn't exist, create it # If overwrite_nginx doesn't exist, create it
if [ -z "$overwrite_nginx" ]; then if [ -z "$overwrite_nginx" ]; then
overwrite_nginx=1 overwrite_nginx=1
ynh_app_setting_set $app overwrite_nginx $overwrite_nginx ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx
fi fi
# If overwrite_phpfpm doesn't exist, create it # If overwrite_phpfpm doesn't exist, create it
if [ -z "$overwrite_phpfpm" ]; then if [ -z "$overwrite_phpfpm" ]; then
overwrite_phpfpm=1 overwrite_phpfpm=1
ynh_app_setting_set $app overwrite_phpfpm $overwrite_phpfpm ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=$overwrite_phpfpm
fi fi
# Cleaning legacy permissions # Cleaning legacy permissions
@ -159,24 +159,10 @@ then
# Copy extra files # Copy extra files
cp -a ../sources/extra_files_radicale/. "$final_path" cp -a ../sources/extra_files_radicale/. "$final_path"
if [ "$infcloud" = "1" ] if [ $infcloud -eq 1 ]
then then
#Instal InfCloud
# Backup the content of $final_path
final_path_backup=$final_path
# Modify final_path for InfCloud installation
final_path=$final_path/infcloud
# If overwrite_infcloud is 0, copy the config file, then restore it.
if [ $overwrite_infcloud -eq 0 ]; then
cp -a $final_path/config.js ./config.js
fi
# Download and uncompress the source into final_path # Download and uncompress the source into final_path
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path/infcloud" --keep="config.js"
if [ $overwrite_infcloud -eq 0 ]; then
mv ./config.js $final_path/config.js
fi
# Restore the content of $final_path
final_path=$final_path_backup
fi fi
fi fi
@ -227,6 +213,7 @@ then
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
fi fi
fi fi
@ -274,9 +261,9 @@ chmod 755 /etc/$app/
chmod 644 /etc/$app/* chmod 644 /etc/$app/*
# Overwrite the InfCloud config file only if it's allowed # Overwrite the InfCloud config file only if it's allowed
if [ $overwrite_infcloud -eq 1 ] if [ $infcloud -eq 1 ]
then then
if [ $infcloud -eq 1 ] if [ $overwrite_infcloud -eq 1 ]
then then
# InfCloud configuration # InfCloud configuration
# Set language # Set language