Skip to content

Commit

Permalink
error check and fix tmp influxDB
Browse files Browse the repository at this point in the history
  • Loading branch information
javadmohebbi committed Oct 19, 2021
1 parent fc6621a commit 4f88fbc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dockerize/build-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ get_influx_db_info() {

echo ""
echo -e "${YELLOW} Renaming old configuraions...${NC}"

unixnan=$(date +%s)
mv $INFLUX_DIR/engine $INFLUX_DIR/engine.old.$unixnan -f > /dev/null 2>&1
check_errors
mv $INFLUX_DIR/influxd.bolt $INFLUX_DIR/influxd.bolt.old.$unixnan > /dev/null 2>&1
check_errors

echo -e "${GREEN}...done!${NC}"

CONTAINERID=influxdb_tmp
Expand All @@ -175,10 +175,7 @@ get_influx_db_info() {
echo ""
echo -e "${YELLOW} Staring temporary InfluxDB container ($CONTAINERID)...${NC}"
# create influxdb tmp image
docker run -d \
-v $INFLUX_DIR:/var/lib/influxdb2 \
--name $CONTAINERID \
influxdb:2
docker run -d -v $INFLUX_DIR:/var/lib/influxdb2 --name $CONTAINERID influxdb:2
check_errors
echo -e "${GREEN}...done!${NC}"

Expand Down Expand Up @@ -471,7 +468,7 @@ cron_jobs() {
# error check and stop on error
check_errors() {
e=$?
if [ "${e}" -ne "0"]; then
if [ "${e}" -ne "0" ]; then
echo -e "${RED} [ERROR] Could not continue due to error. Check the above information to solve the issue".
exit 1
fi
Expand Down

0 comments on commit 4f88fbc

Please sign in to comment.