-
Notifications
You must be signed in to change notification settings - Fork 0
/
initEbinaStation.sh
executable file
·32 lines (28 loc) · 1023 Bytes
/
initEbinaStation.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
#!/bin/sh
cd `dirname $0`
SCRIPT_DIR=$(pwd)
if !(type docker > /dev/null 2>&1); then
echo "Please install docker"
exit 1
fi
if !(type docker-compose > /dev/null 2>&1); then
echo "Please install docker-compose"
exit 1
fi
if (type deno > /dev/null 2>&1); then
DENO_PATH=$(which deno)
DENO_DIR=`echo ${DENO_PATH%/deno}|sed -e 's/\//\\\\\//g'`
sed -e "s/#export.*/cd ..\nexport PATH=$DENO_DIR:\$PATH/" startEbinaStation.sh > ./generate/startEbinaStation.sh
sudo chmod 755 ./generate/startEbinaStation.sh
else
echo "Please install deno"
exit 1
fi
if (type systemctl > /dev/null 2>&1); then
ESCAPED=`echo ${SCRIPT_DIR}|sed -e 's/\//\\\\\//g'`
sed -e "s/ExecStart.*/ExecStart=$ESCAPED\/generate\/startEbinaStation.sh/" ebina-station.service.base > ./generate/ebina-station.service
if [ ! -e /etc/systemd/system/ebina-station.service ]; then
echo "link ebina-station.service to systemd"
sudo ln -s ${SCRIPT_DIR}/generate/ebina-station.service /etc/systemd/system/ebina-station.service
fi
fi