-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_codespace.sh
56 lines (50 loc) · 2.61 KB
/
setup_codespace.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -e
# echo $(jq -r ".CODESPACE_NAME" /workspaces/.codespaces/shared/environment-variables.json)
CHOST=${CODESPACE_NAME}
PORT_8000=`echo "${CHOST}-8000.app.github.dev"`
PORT_9000=`echo "${CHOST}-9000.app.github.dev"`
PORT_10000=`echo "${CHOST}-10000.app.github.dev"`
PORT_30333=`echo "${CHOST}-30333.app.github.dev"`
PORT_30334=`echo "${CHOST}-30334.app.github.dev"`
PORT_30337=`echo "${CHOST}-30337.app.github.dev"`
# personalized javascript url
P_URL="assets/info/personalized.js"
echo " personalizedNodes = [" > $P_URL
echo " {" >> $P_URL
echo " \"protocol\": \"https\"," >> $P_URL
echo " \"url\": \"$PORT_10000\"," >> $P_URL
echo " \"location\": \"worldwide\"," >> $P_URL
echo " \"locale\": \"worldwide\"," >> $P_URL
echo " \"type\": \"ecocompilers\"" >> $P_URL
echo " }," >> $P_URL
echo " {" >> $P_URL
echo " \"protocol\": \"https\"," >> $P_URL
echo " \"url\": \"$PORT_9000\"," >> $P_URL
echo " \"location\": \"worldwide\"," >> $P_URL
echo " \"locale\": \"worldwide\"," >> $P_URL
echo " \"type\": \"ecoservices\"" >> $P_URL
echo " }," >> $P_URL
echo " {" >> $P_URL
echo " \"protocol\": \"https\"," >> $P_URL
echo " \"url\": \"$PORT_30333\"," >> $P_URL
echo " \"location\": \"worldwide\"," >> $P_URL
echo " \"locale\": \"worldwide\"," >> $P_URL
echo " \"type\": \"RPC\"" >> $P_URL
echo " }," >> $P_URL
echo " {" >> $P_URL
echo " \"protocol\": \"https\"," >> $P_URL
echo " \"url\": \"$PORT_30334\"," >> $P_URL
echo " \"location\": \"worldwide\"," >> $P_URL
echo " \"locale\": \"worldwide\"," >> $P_URL
echo " \"type\": \"RPC\"" >> $P_URL
echo " }," >> $P_URL
echo " {" >> $P_URL
echo " \"protocol\": \"https\"," >> $P_URL
echo " \"url\": \"$PORT_30337\"," >> $P_URL
echo " \"location\": \"worldwide\"," >> $P_URL
echo " \"locale\": \"worldwide\"," >> $P_URL
echo " \"type\": \"RPC\"" >> $P_URL
echo " }" >> $P_URL
echo " ]" >> $P_URL
echo "Finished updating $P_URL"