<commit_before>#!/bin/bash
#
# Startup script for the custom homeassistant container
#
# <NAME>, October 2018
########################################################

# make sure influxDB is up
while ! wget -q http://localhost:3004 -O /dev/null; do
  sleep 10
done

# make sure the IOMega disk is mounted, but give up after 5 mins
n=0
while ! ssh hass@naslopresti 'df | grep iomega' > /dev/null; do
  sleep 5
  let "n=n+1"
  if [ "$n" -eq 60 ]; then
    break
  fi
done

# standard Home Assistant startup
python -m homeassistant --config /config
<commit_msg>Improved docker startup script<commit_after>#!/bin/bash
#
# Startup script for the custom homeassistant container
#
# <NAME>, October 2018
########################################################

# make sure influxDB is up
n=0
while ! wget -q http://localhost:3004 -O /dev/null; do
  sleep 10
  let "n=n+1"
  if [ "$n" -eq 60 ]; then
    # after (and every) 10 mins attempt to restart it
    ssh hass@naslopresti ./qnap_restart_influx.sh
    let "n=0"
  fi
done

# make sure the IOMega disk is mounted, but give up after 5 mins
n=0
while ! ssh hass@naslopresti 'df | grep iomega' > /dev/null; do
  sleep 5
  let "n=n+1"
  if [ "$n" -eq 60 ]; then
    break
  fi
done

# standard Home Assistant startup
python -m homeassistant --config /config

{'fraction_non_alphanumeric': 0.1841903300076746, 'fraction_numerical': 0.029930928626247123, 'mean_word_length': 3.624113475177305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5752211', 'n_tokens_mistral': 478, 'n_tokens_neox': 427, 'n_words': 164}