Skip to content

Commit e5971d7

Browse files
committed
Update installation script to dynamically assign ports to env variables
1 parent a191f4d commit e5971d7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

install.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,51 @@ then
9090
fi
9191
fi
9292

93+
if [ "$GEOCML_POSTGRES_PORT" == "" ]
94+
then
95+
echo "\nPlease enter the port you want to use to access geoCML Postgres."
96+
read GEOCML_POSTGRES_PORT
97+
export GEOCML_POSTGRES_PORT=$GEOCML_POSTGRES_PORT
98+
touch ~/.bashrc &> /dev/null
99+
if grep -q GEOCML_POSTGRES_PORT ~/.bashrc; then
100+
echo "[INFO] Updating GEOCML_POSTGRES_PORT in your bash profile."
101+
sed -i '' 's/export GEOCML_POSTGRES_PORT=.*/export GEOCML_POSTGRES_PORT='$GEOCML_POSTGRES_PORT'/' ~/.bashrc
102+
else
103+
echo "[INFO] Adding this to your bash profile for future use."
104+
echo "export GEOCML_POSTGRES_PORT=$GEOCML_POSTGRES_PORT" >> ~/.bashrc
105+
fi
106+
fi
107+
108+
if [ "$GEOCML_DESKTOP_PORT" == "" ]
109+
then
110+
echo "\nPlease enter the port you want to use to access geoCML Desktop."
111+
read GEOCML_DESKTOP_PORT
112+
export GEOCML_DESKTOP_PORT=$GEOCML_DESKTOP_PORT
113+
touch ~/.bashrc &> /dev/null
114+
if grep -q GEOCML_DESKTOP_PORT ~/.bashrc; then
115+
echo "[INFO] Updating GEOCML_DESKTOP_PORT in your bash profile."
116+
sed -i '' 's/export GEOCML_DESKTOP_PORT=.*/export GEOCML_DESKTOP_PORT='$GEOCML_DESKTOP_PORT'/' ~/.bashrc
117+
else
118+
echo "[INFO] Adding this to your bash profile for future use."
119+
echo "export GEOCML_DESKTOP_PORT=$GEOCML_DESKTOP_PORT" >> ~/.bashrc
120+
fi
121+
fi
122+
123+
if [ "$GEOCML_SERVER_PORT" == "" ]
124+
then
125+
echo "\nPlease enter the port you want to use to access geoCML Server."
126+
read GEOCML_SERVER_PORT
127+
export GEOCML_SERVER_PORT=$GEOCML_SERVER_PORT
128+
touch ~/.bashrc &> /dev/null
129+
if grep -q GEOCML_SERVER_PORT ~/.bashrc; then
130+
echo "[INFO] Updating GEOCML_SERVER_PORT in your bash profile."
131+
sed -i '' 's/export GEOCML_SERVER_PORT=.*/export GEOCML_SERVER_PORT='$GEOCML_SERVER_PORT'/' ~/.bashrc
132+
else
133+
echo "[INFO] Adding this to your bash profile for future use."
134+
echo "export GEOCML_SERVER_PORT=$GEOCML_SERVER_PORT" >> ~/.bashrc
135+
fi
136+
fi
137+
93138
if [ "$GEOCML_INSTALLATION_METHOD" == "" ]
94139
then
95140
echo "\nPlease select how you want to install geoCML to this machine."

0 commit comments

Comments
 (0)