@@ -562,20 +562,20 @@ send_notification() {
562562 # Get a random joke from the specified file
563563 # Check if the webhook is for discord
564564 if [[ " $webhook " =~ ^https://discord\. com/api/webhooks/ ]]; then
565- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
565+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
566566 discord_common_fields
567567 bot_name=" Notification Bot"
568568 # Call the discord_payload function to construct the payload
569569 if [ ${# new_container[@]} -gt 0 ]; then
570- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
570+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
571571 new_container_notification
572572 new_container_response=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
573573 if [ " $dry_run " == " true" ]; then
574574 echo " $new_container_response "
575575 fi
576576 fi
577577 if [ ${# removed_containers[@]} -gt 0 ]; then
578- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
578+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
579579 removed_container_notification
580580 removed_container=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
581581 if [ " $dry_run " == " true" ]; then
@@ -594,19 +594,19 @@ send_notification() {
594594 fi
595595 # Check if the webhook is for notifiarr
596596 if [[ $webhook =~ ^https://notifiarr\. com/api/v1/notification/passthrough ]]; then
597- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
597+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
598598 notifiarr_common_fields
599599 # Call the notifiarr_payload function to construct the payload
600600 if [ ${# new_container[@]} -gt 0 ]; then
601- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
601+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
602602 new_container_notification
603603 new_container_response=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
604604 if [ " $dry_run " == " true" ]; then
605605 echo " $new_container_response "
606606 fi
607607 fi
608608 if [ ${# removed_containers[@]} -gt 0 ]; then
609- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
609+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
610610 removed_container_notification
611611 removed_container=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
612612 if [ " $dry_run " == " true" ]; then
0 commit comments