forked from cytopia/devilbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·36 lines (24 loc) · 995 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
SRC=$(cd $(dirname "$0"); pwd)
# Colors
readonly BLUE=$'\e[36;01m'
readonly NORMAL=$'\e[0m'
readonly YELLOW=$'\e[33;01m'
WEB_PATH="${SRC}/../www-docker"
echo ""
echo "${BLUE} Create Webserver Path in ${SRC}/../www-docker ${NORMAL}"
mkdir -p "${WEB_PATH}"
echo ""
# Put local environement into
echo "${BLUE} Put Webserver path into .env ${NORMAL}";
cp env-code-sample .env
sed -i '' "s|HOST_PATH_HTTPD_DATADIR=./data/www|HOST_PATH_HTTPD_DATADIR=${WEB_PATH}|g" .env
echo "${BLUE} Write local environnement into ${HOME}/.devilbox ${NORMAL}";
echo "# This file is generated automatically, does not edit or does not restart the install.sh script in Devilbox" > "${HOME}/.devilbox"
echo "HOST_PATH_HTTPD_DATADIR=${WEB_PATH}" >> "${HOME}/.devilbox"
echo "DEVILBOX_LOCAL_PATH=${SRC}" >> "${HOME}/.devilbox"
echo ""
if [ -f "${WEB_PATH}/.devilbox" ]; then
echo "${YELLOW} Remove old devilbox config into ${DIR}/../www-docker/.devilbox ${NORMAL}";
rm "${WEB_PATH}/.devilbox"
fi