From 5e446efd2482e8ee87ab3aaeac6736694e86fcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Mon, 8 Mar 2021 11:45:06 +0100 Subject: [PATCH] Fix rosti.sh * Check if symlink exists before it's created --- Makefile | 4 ++-- rosti.sh.tmp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8141b96..850319c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ DOCKER=docker -VERSION=2021.02-1 +VERSION=2021.03-1 all: build @@ -16,4 +16,4 @@ squashed: push: squashed $(DOCKER) tag rosti/runtime:dev-squashed rosti/runtime:$(VERSION) - $(DOCKER) push rosti/runtime:$(VERSION) + $(DOCKER) push rosti/runtime:$(VERSION) diff --git a/rosti.sh.tmp b/rosti.sh.tmp index a9bc29b..b846f44 100755 --- a/rosti.sh.tmp +++ b/rosti.sh.tmp @@ -28,7 +28,8 @@ function setTech() { tech=$1 # Activation of primary tech bin directory - test ! -e $PRIMARYDIR || $TECHDIR/$tech/bin + # test ! -e $PRIMARYDIR || $TECHDIR/$tech/bin + test -L $PRIMARYDIR && unlink $PRIMARYDIR ln -s $TECHDIR/$tech/bin $PRIMARYDIR # Parse name of the tech - like python or node @@ -51,7 +52,7 @@ function setTech() { echo "IMPORTANT: /srv/venv exists, if you have changed python version, make sure to create or update the virtualenv:" echo echo " rm -rf /srv/venv" - echo " python3 -m venv /srv/venv)" + echo " python3 -m venv /srv/venv" echo echo "Don't forget to backup the old venv if necessary." else @@ -71,7 +72,7 @@ function setTech() { test -e /srv/conf/php-fpm/pool.d/app.conf || mv /srv/app/pool_app.conf /srv/conf/php-fpm/pool.d/app.conf test -e /srv/conf/php-fpm/php.ini || mv /srv/app/php.ini /srv/conf/php-fpm/php.ini - ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini + test ! -e /srv/conf/php-fpm/php.ini && ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini # And remove unneeded ones # TODO: not sure how good idea this is