-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx-add-project
executable file
·43 lines (33 loc) · 1.27 KB
/
nginx-add-project
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
37
38
39
40
41
42
#!/usr/bin/env bash
if [ ! -n "$1" ]
then
echo "error: Parameter project_group and project_name not found"
#echo -e "Usage: nginx-add-project [OPTIONS] [PROJECT_NAME]\n\nOptions:\n -s, --share Create project shred on PROJECT_NAME.d.shogo-test.ru"
echo -e "Usage: nginx-add-project [PROJECT_GROUP] [PROJECT_NAME]"
exit 1
fi
if [ ! -n "$2" ]
then
echo "error: Parameter project_name not found"
#echo -e "Usage: nginx-add-project [OPTIONS] [PROJECT_NAME]\n\nOptions:\n -s, --share Create project shred on PROJECT_NAME.d.shogo-test.ru"
echo -e "Usage: nginx-add-project [PROJECT_GROUP] [PROJECT_NAME]"
exit 1
fi
PROJECT_GROUP=$1
PROJECT_NAME=$2
templateConfigFile="/var/www/laradock/nginx/template_argilla.conf.example"
configFile="/var/www/laradock/nginx/sites/$PROJECT_NAME.conf"
if [ -e "$configFile" ]
then
echo "Config $configFile already exists"
exit 1
fi
#logPath="/var/www/laradock/logs/nginx/$PROJECT_NAME"
#mkdir $logPath
#chmod 777 $logPath
sed -e "s/project_name/$PROJECT_NAME/g" -e "s/project_group/$PROJECT_GROUP/g" $templateConfigFile > $configFile
#sed "s/project_name/$PROJECT_NAME/" $templateConfigFile > $configFile
#sed "s/project_group/$PROJECT_GROUP/" $configFile > $configFile
cd /var/www/laradock
docker-compose restart nginx
echo "complited"