-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup
33 lines (28 loc) · 1.05 KB
/
setup
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
#!/bin/sh
common_js="
var fss_port = 4001,
fsdb_port = 4002,
ffs_port = 3122;
exports.allow_fss_origin = [\"https://www.fsynth.com:8042\", \"https://fsynth.com:8042\", \"https://www.fsynth.com\", \"https://fsynth.com\"];
exports.allow_fsdb_origin = [\"https://www.fsynth.com:8042\", \"https://fsynth.com:8042\", \"https://www.fsynth.com\", \"https://fsynth.com\"];
exports.fss_port = fss_port;
exports.fsdb_port = fsdb_port;
exports.ffs_port = ffs_port;"
chmod -R 755 ../fsynth
chown -R fs:fs ../fsynth
echo "$common_js" > common.js
sed 's/"127.0.0.1"/"www.fsynth.com"/' client/dist/fs.min.js > temp
mv temp client/dist/fs.min.js
sed 's/="ws"/="wss"/' client/dist/fs.min.js > temp
mv temp client/dist/fs.min.js
sed 's/"dist\/fs.js"/"dist\/fs.min.js"/' client/index.html > temp
mv temp client/index.html
rm setup
if [ "$1" = "restart" ]; then
su - fs -c "pm2 restart $2"
elif [ "$1" = "update" ]; then
su - fs -c "pm2 sendSignal SIGUSR1 $2"
elif [ "$1" = "updateall" ]; then
su - fs -c "pm2 sendSignal SIGUSR1 fss"
su - fs -c "pm2 sendSignal SIGUSR1 fsdb"
fi