forked from 6Ministers/flectra-2.0dev-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
24 lines (18 loc) · 822 Bytes
/
run.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
#!/bin/bash
DESTINATION=$1
PORT=$2
CHAT=$3
# clone Flectra directory
git clone --depth=1 https://github.com/6Ministers/flectra-2.0dev-docker-compose $DESTINATION
rm -rf $DESTINATION/.git
# set permission
mkdir -p $DESTINATION/postgresql
sudo chmod -R 777 $DESTINATION
# config
if grep -qF "fs.inotify.max_user_watches" /etc/config/sysctl.conf; then echo $(grep -F "fs.inotify.max_user_watches" /etc/config/sysctl.conf); else echo "fs.inotify.max_user_watches = 524288" | sudo tee -a /etc/config/sysctl.conf; fi
sudo sysctl -p
sed -i 's/10020/'$PORT'/g' $DESTINATION/docker-compose.yml
sed -i 's/20020/'$CHAT'/g' $DESTINATION/docker-compose.yml
# run Flectra
docker-compose -f $DESTINATION/docker-compose.yml up -d
echo 'Started Flectra @ http://ip:'$PORT' | Master Password: master.password | Live chat port: '$CHAT