diff --git a/generate_text.sh b/generate_text.sh index f02f564..e64d403 100755 --- a/generate_text.sh +++ b/generate_text.sh @@ -11,7 +11,7 @@ text_dir="/root/iobroker_scripts/general/.text" html_file="$text_dir/handout.html" -all=("date" "time") # Add more elements as needed +all=("date" "time" "weather") # Add more elements as needed # remove files in text_dir rm -f $text_dir/* @@ -51,44 +51,67 @@ generate_text() { echo "$date_de" > "$text_dir/date_de.txt" time_de=$(date '+Es ist %H:%M Uhr.') echo "$time_de" > "$text_dir/time_de.txt" + weather_de=$(trans -b :en :de "$(/root/iobroker_scripts/general/weather.sh)") + echo "$weather_de" > "$text_dir/weather_de.txt" # Spanish date_es=$(trans -b :de :es "$date_de") echo "$date_es" > "$text_dir/date_es.txt" time_es=$(trans -b :de :es "$time_de") echo "$time_es" > "$text_dir/time_es.txt" + weather_es=$(trans -b :en :es "$(/root/iobroker_scripts/general/weather.sh)") + echo "$weather_es" > "$text_dir/weather_es.txt" } # Call the generate_text function generate_text -# Create Markdown content -markdown_content="**Handout:** -\n -| Deutsch | Español | -| ------- | -------- |" +# Create HTML file +echo "" >> "$html_file" +echo "" >> "$html_file" +echo "
" >> "$html_file" +echo "| Deutsch | Español |
|---|---|
| $german_output | $spanish_output |