-
-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·31 lines (23 loc) · 732 Bytes
/
start.sh
File metadata and controls
executable file
·31 lines (23 loc) · 732 Bytes
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
#!/bin/bash
set -e
export LOGDIR=/var/log/airnotifier
export LOGFILE=$LOGDIR/airnotifier.log
export LOGFILE_ERR=$LOGDIR/airnotifier.err
if [ ! -f "./config.py" ]; then
cp config.py-sample config.py
fi
sed -i 's/https = True/https = False/g' ./config.py
if [ ! -f "./logging.ini" ]; then
cp logging.ini-sample logging.ini
fi
sed -i "s/mongouri = \"mongodb:\/\/localhost:27017\/\"/mongouri = \"mongodb:\/\/${MONGO_SERVER-localhost}:${MONGO_PORT-27017}\"/g" ./config.py
if [ ! -f "$LOGFILE" ]; then
touch "$LOGFILE"
fi
if [ ! -f "$LOGFILE_ERR" ]; then
touch "$LOGFILE_ERR"
fi
echo "Installing AirNotifier ..."
pipenv run ./install.py
echo "Starting AirNotifier ..."
pipenv run ./app.py >> "$LOGFILE" 2>> "$LOGFILE_ERR"