diff --git a/generate_text.sh b/generate_text.sh index 3e95149..f02f564 100755 --- a/generate_text.sh +++ b/generate_text.sh @@ -62,49 +62,33 @@ generate_text() { # Call the generate_text function generate_text -# Create HTML file -echo "" > "$html_file" -echo "" >> "$html_file" -echo "" >> "$html_file" -echo "Handout" >> "$html_file" -echo "" >> "$html_file" -echo "" >> "$html_file" -echo "" >> "$html_file" -echo "

Handout:

" >> "$html_file" -echo "" >> "$html_file" -echo "" >> "$html_file" +# Create Markdown content +markdown_content="**Handout:** +\n +| Deutsch | Español | +| ------- | -------- |" for component in "${all[@]}"; do - echo "processing: $component" german_output=$(cat "$text_dir/${component}_de.txt") spanish_output=$(cat "$text_dir/${component}_es.txt") - echo "" >> "$html_file" + markdown_content+="\n| $german_output | $spanish_output |" done -echo "
DeutschEspañol
$german_output$spanish_output
" >> "$html_file" -echo "" >> "$html_file" -echo "" >> "$html_file" +# Send Notification to A72 with Markdown content +curl_command="curl -u 'Michaelis:u5ptufUFuDL6q4yEcSN3iqas5gtXNkN77Lx3cy3oX8UoSgFWdifYy9FVopv2Zwtu' \ + -H 'Priority:High' \ + -d \"$markdown_content\" \ + -H 'Markdown: yes' \ + https://ntfy.michaelis.digital/ioBroker" + +echo "curl_command: $curl_command" +eval "$curl_command" # Execute the constructed curl command # Transfer files to A72 -scp -r -i /root/.ssh/A72 "$text_dir" root@$A72_ip:/data/scripts/ +scp -r -i /root/.ssh/A72 "$text_dir" root@$A72_ip:/sdcard/ -# Display Markdown file content -cat $markdown_file +# Display Markdown content +echo -e "$markdown_content" # Start generate_mp3.sh on A72 nohup ssh -i /root/.ssh/A72 -f root@$A72_ip '/data/scripts/generate_mp3.sh' > /root/generate_mp3.log & -