#!/bin/bash #================================================= # GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 if [[ $path = "/" ]] then nodes_url="/" admin_url="/admin" else nodes_url="$path" admin_url="$path/admin" fi #================================================= # STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS #================================================= # ALTERED NODERED SETTINGS FILE #================================================= ynh_add_config --template="../conf/settings.js" --destination="$install_dir/data/settings.js" chmod o-rwx "$install_dir/data/settings.js" chown -R $app: "$install_dir/data/settings.js" #================================================= # GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Change of URL completed for $app" --last