Fix rosti.sh

* Check if symlink exists before it's created
This commit is contained in:
Adam Štrauch 2021-03-08 11:45:06 +01:00
parent 63d5507a91
commit 5e446efd24
Signed by: cx
GPG Key ID: 018304FFA8988F8D
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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