From 82bbdef4d7298c63245c114be49fd3c6d05f6d94 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Fri, 28 Sep 2018 21:55:44 +0530 Subject: [PATCH] Put commenting at right palce --- scripts/upgrade | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 245bd27..0aab3ae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,12 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CHECK THE PATH +#================================================= +# Normalize the URL path syntax +path_url=$(ynh_normalize_url_path $path_url) # Add Dependencies ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' @@ -52,7 +57,11 @@ fi # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" + +# Copy config file for correct place cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php" + +# Replace strings in config file ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php" ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php" ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php" @@ -60,13 +69,6 @@ ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php" ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php" -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - #Copy Addons rm -Rf "$final_path/addon" @@ -87,7 +89,6 @@ chown -R $app: $final_path # Create a dedicated nginx config ynh_add_nginx_config -# configure friendica #================================================= # PHP-FPM CONFIGURATION @@ -101,7 +102,7 @@ ynh_backup_if_checksum_is_different "$final_path/config/local.ini.php" # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/config/local.ini.php" -# Set up poller +# Set up cron job ynh_replace_string "__YNH_WWW_PATH__" "$final_path" ../conf/poller-cron ynh_replace_string "__USER__" "$app" ../conf/poller-cron sudo cp ../conf/poller-cron /etc/cron.d/$app