diff --git a/scripts/install b/scripts/install index 01d9921..359b09a 100644 --- a/scripts/install +++ b/scripts/install @@ -99,10 +99,11 @@ sleep 5 systemctl stop jellyfin # Port config -ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/system.xml" +ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/network.xml" +ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/network.xml" # BaseUrl config -ynh_replace_string --match_string="" --replace_string="$path_url" --target_file="/etc/jellyfin/system.xml" +ynh_replace_string --match_string="" --replace_string="$path_url" --target_file="/etc/jellyfin/network.xml" # Disable Setup Wizard ynh_replace_string --match_string="false" --replace_string="true" --target_file="/etc/jellyfin/system.xml" diff --git a/scripts/upgrade b/scripts/upgrade index cbbc124..ed18b31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,6 +74,28 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +# Check if network.xml exists (introduced in v10.7) +if [ -z "/etc/jellyfin/network.xml" ]; then + ynh_script_progression --message="Configuring the settings..." --weight=1 + + # Load services once to generate network.xml + systemctl enable jellyfin + systemctl start jellyfin + sleep 5 + systemctl stop jellyfin + + # Port config + ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/network.xml" + ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/network.xml" + + # BaseUrl config + ynh_replace_string --match_string="" --replace_string="$path_url" --target_file="/etc/jellyfin/network.xml" +fi + #================================================= # INSTALL LDAP PLUGIN #=================================================