From 631ad0c85974770c0078cc2d4a91b24b7e2c9104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Thu, 2 Feb 2023 23:19:31 +0100 Subject: [PATCH] Fix of rosti * Default app works * static tech = default tech * cancel fixed --- rosti.tmpl.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rosti.tmpl.sh b/rosti.tmpl.sh index 6e97071..f9c79d6 100755 --- a/rosti.tmpl.sh +++ b/rosti.tmpl.sh @@ -48,7 +48,9 @@ function setTech() { echo "NOTE: /srv/app doesn't exists, creating it from $tech example application" mkdir -p /srv/app cp -a /opt/examples/$name/* /srv/app/ - test $name -eq "default" || mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf + if [ -e /srv/app/supervisor.conf ]; then + mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf + fi else echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process" fi @@ -98,13 +100,14 @@ function setTech() { # Same thing we do for nginx but if the file exist it's not rewritten. if [ ! -e /srv/conf/nginx.d/app.conf ]; then mkdir -p /srv/conf/nginx.d - if [ "$name" = "php" ]; then - cp /opt/examples/php/nginx.conf /srv/conf/nginx.d/app.conf + if [ -e /opt/examples/$tech/nginx.conf ]; then + cp /opt/examples/$tech/nginx.conf /srv/conf/nginx.d/app.conf + rm /srv/app/nginx.conf else cp /opt/examples/nginx/nginx.conf /srv/conf/nginx.d/app.conf fi + echo ".. app configuration for nginx not found, adding it - please check /srv/conf/nginx.d/app.conf and make sure it fits your code" - fi # We load new configuration into supervisor and it's automatically started or restarted if needed @@ -208,6 +211,9 @@ function quickTech() { "default") setTech $TECH ;; + "static") + setTech default + ;; esac } @@ -234,6 +240,10 @@ while /bin/true; do menuitem=$MENUITEM fi + if [ $? -ne 0 ]; then + exit 0 + fi + case $menuitem in # Activation of one of the available tech # Only one tech can be enabled same time but it's possible to use any of them from /opt/techs