diff --git a/sources/config.php b/conf/config.php.tpl similarity index 100% rename from sources/config.php rename to conf/config.php.tpl diff --git a/scripts/install b/scripts/install index 8028759..3b3b3c4 100644 --- a/scripts/install +++ b/scripts/install @@ -247,8 +247,8 @@ ynh_replace_string --match_string="^DAEMON_CONF=$" --replace_string="&/etc/hosta # isnt used ... instead the service is "pure systemd" ... echo "DAEMON_CONF=/etc/hostapd/hostapd.conf" > /etc/default/hostapd -# Fix sources -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url}" --target_file="$final_path/config.php" +# Apply configuration +ynh_add_config --template="config.php.tpl" --destination="$final_path/config.php" # Set default inits # The boot order of these services are important, so they are disabled by default @@ -263,7 +263,6 @@ systemctl unmask hostapd # On some system e.g. RPi, for some reason hostapd is m ynh_script_progression --message="Storing the config file checksum..." # Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/config.php" ynh_store_file_checksum --file="/etc/init.d/hostapd" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ff365bd..7dc0b62 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -162,10 +162,7 @@ ynh_replace_string --match_string="__PHPVERSION__" --replace_string="${phpversio #================================================= ynh_script_progression --message="Modifying a config file..." -ynh_backup_if_checksum_is_different --file="$final_path/config.php" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url}" --target_file="$final_path/config.php" -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$final_path/config.php" +ynh_add_config --template="config.php.tpl" --destination="$final_path/config.php" #================================================= # SETUP SYSTEMD