From 29d2b6e56836ffbe8628fbc74140b9dd4e617058 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Feb 2021 10:28:59 +0100 Subject: [PATCH] Remove sudo --- conf/config.php | 2 +- scripts/install | 3 +-- scripts/upgrade | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/config.php b/conf/config.php index b5510ba..503af1a 100644 --- a/conf/config.php +++ b/conf/config.php @@ -11,7 +11,7 @@ define('YOURLS_DB_USER', '__DB_NAME__'); /** MySQL database password */ -define('YOURLS_DB_PASS', '__DB_PASSWORD__'); +define('YOURLS_DB_PASS', '__DB_PWD__'); /** The name of the database for YOURLS */ define('YOURLS_DB_NAME', '__DB_NAME__'); diff --git a/scripts/install b/scripts/install index 08c263c..ff1d319 100644 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= - ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app @@ -103,7 +102,7 @@ cp ../conf/index.php $final_path/ cp ../conf/config.php $final_path/user/config.php ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" diff --git a/scripts/upgrade b/scripts/upgrade index d3d9d20..b6ef43f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,10 +126,10 @@ ynh_script_progression --message="Modifying a config file..." --weight=2 # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different --file="$final_path/user/config.php" -sudo cp ../conf/config.php $final_path/user/config.php +cp ../conf/config.php $final_path/user/config.php ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php"