Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the parameters from /etc/nsconfig when the file is being reloaded. #36

Open
wants to merge 1 commit into
base: Navid_2022_11_16
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions NS_Install2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ then
cat > /etc/nightscout-start.sh << "EOF"
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
. /etc/nsconfig
export MONGO_COLLECTION="entries"
export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout"
export INSECURE_USE_HTTP=true
export HOSTNAME="127.0.0.1"
export PORT="1337"
cd /srv/nightscout-vps
while [ "`netstat -lnt | grep 27017 | grep -v grep`" = "" ]
do
Expand All @@ -83,21 +77,21 @@ done
sleep 5
while [ 1 ]
do
. /etc/nsconfig
export MONGO_COLLECTION="entries"
export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout"
export INSECURE_USE_HTTP=true
export HOSTNAME="127.0.0.1"
export PORT="1337"
node server.js
sleep 30
sleep 10
done
EOF

else # We are testing.
cat > /etc/nightscout-start.sh << "EOF"
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
. /etc/nsconfig
export MONGO_COLLECTION="entries"
export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout"
export INSECURE_USE_HTTP=true
export HOSTNAME="127.0.0.1"
export PORT="1337"
cd /srv/cgm-remote-monitor
while [ "`netstat -lnt | grep 27017 | grep -v grep`" = "" ]
do
Expand All @@ -107,8 +101,15 @@ done
sleep 5
while [ 1 ]
do
. /etc/nsconfig
export MONGO_COLLECTION="entries"
export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout"
export INSECURE_USE_HTTP=true
export HOSTNAME="127.0.0.1"
export PORT="1337"

node server.js
sleep 30
sleep 10
done
EOF

Expand Down