ninesurvey/src/ninesurvey-1.0/scripts/reconfigure.sh

47 lines
944 B
Bash
Raw Normal View History

2020-11-12 11:58:50 +01:00
#!/bin/bash
# Se positionner sur la racine du projet
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${DIR}
cd ..
DIR=$(pwd)
2020-11-23 13:08:01 +01:00
# Mise en place du fichier d'environnement model
yes 2>/dev/null | cp $DIR/scripts/.env.model $DIR/.env
2020-11-13 13:31:34 +01:00
# Import des env
. $DIR/.env
. $DIR/.env.local
2020-11-12 11:58:50 +01:00
# Déclaration d'un proxy
2020-11-23 13:08:01 +01:00
if [[ "$PROXY_USE" == "1" ]]
2020-11-13 13:31:34 +01:00
then
export HTTP_PROXY="$PROXY_HOST:$PROXY_PORT"
export HTTPS_PROXY="$PROXY_HOST:$PROXY_PORT"
fi
2020-11-12 11:58:50 +01:00
# Suppression des logs trop ancien
2020-11-13 13:31:34 +01:00
if [[ -d $DIR/var/log ]]
then
2020-11-12 11:58:50 +01:00
find $DIR/var/log -mindepth 1 -mtime +7 -delete
2020-11-13 13:31:34 +01:00
fi
2020-11-12 11:58:50 +01:00
# Installation des dépendances composer
echo COMPOSER = Install
composer install --quiet
php bin/console app:AppInit --env=prod
php bin/console app:CronInit --env=prod
php bin/console app:Script --env=prod
2020-11-23 13:08:01 +01:00
# Websocket
if [[ "$WSS_USE" == "1" ]]
then
$DIR/scripts/websocket.sh restart
fi
2020-11-12 11:58:50 +01:00
# Permissions
echo PERMISSIONS
./scripts/perm.sh www-data
echo