diff --git a/scripts/install b/scripts/install index 4c5efa4..d0c1566 100644 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -path=$YNH_APP_ARG_PATH +path_url=$YNH_APP_ARG_PATH app=$YNH_APP_INSTANCE_NAME welcometext=$YNH_APP_ARG_WELCOMETEXT registerName=$YNH_APP_ARG_REGISTERNAME @@ -72,6 +72,8 @@ yunohost firewall allow Both "$port" if [ "$mumbleweb" -eq 1 ] ; then port_web=$(ynh_find_port 64738) ynh_app_setting_set "$app" port_web "$port_web" + # Open port in firewall + yunohost firewall allow Both "$port_web" fi #================================================= @@ -158,6 +160,8 @@ fi ynh_add_systemd_config if [ "$mumbleweb" -eq 1 ] ; then + ynh_replace_string "__PORT__" "$port" "../conf/mumble-web.service" + ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/mumble-web.service" ynh_add_systemd_config "$app-web" mumble-web.service fi diff --git a/scripts/remove b/scripts/remove index 234499b..de8e1fc 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,8 +18,9 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) port=$(ynh_app_setting_get "$app" port) +port_web=$(ynh_app_setting_get "$app" port_web) +mumbleweb=$(ynh_app_setting_get "$app" mumbleweb) final_path=$(ynh_app_setting_get "$app" final_path) - #================================================= # STANDARD REMOVE #================================================= @@ -78,6 +79,14 @@ then yunohost firewall disallow Both "$port" > /dev/null 2>&1 fi +if [ "$mumbleweb" -eq 1 ] ; then + if yunohost firewall list | grep -q "\- $port_web$" + then + echo "Close port $port_web" + yunohost firewall disallow Both "$port_web" > /dev/null 2>&1 + fi +fi + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 46fef48..3adcb12 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -202,6 +202,8 @@ ynh_script_progression --message="Upgrading systemd configuration..." --time --w ynh_add_systemd_config if [ "$mumbleweb" -eq 1 ] ; then + ynh_replace_string "__PORT__" "$port" "../conf/mumble-web.service" + ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/mumble-web.service" ynh_add_systemd_config "$app-web" mumble-web.service fi