diff --git a/rosti.tmpl.sh b/rosti.tmpl.sh index 51e90ce..76bfd6d 100755 --- a/rosti.tmpl.sh +++ b/rosti.tmpl.sh @@ -99,11 +99,11 @@ function setTech() { test -e /srv/conf/nginx.d/default.conf && rm -f /srv/conf/nginx.d/default.conf # Same thing we do for nginx but if the file exist it's not rewritten. - if [ ! -e /srv/conf/nginx.d/app.conf ]; then + # Except if the file is in /srv/app, then it's moved to /srv/conf/nginx.d + if [ ! -e /srv/conf/nginx.d/app.conf -o -e /srv/app/nginx.conf ]; then mkdir -p /srv/conf/nginx.d - 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 + if [ -e /srv/app/nginx.conf ]; then + mv /srv/app/nginx.conf /srv/conf/nginx.d/app.conf else cp /opt/examples/nginx/nginx.conf /srv/conf/nginx.d/app.conf fi