From d72ce0ea5165d1aff5da2e1596d12c7572ab7f2f Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Fri, 23 Jun 2023 19:51:02 -0500 Subject: [PATCH] new: Added support for ntfy.sh --- build_revanced.sh | 14 ++++++++++++++ build_settings | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/build_revanced.sh b/build_revanced.sh index c76bfa7..2fa53e2 100755 --- a/build_revanced.sh +++ b/build_revanced.sh @@ -277,6 +277,20 @@ if $GOTIFY_NOTIFICATIONS; then -F "title=⚙⚙⚙ Build Details ⚙⚙⚙" -F "message=$MESSAGE" -F "priority=5" fi +if $NTFY_NOTIFICATIONS; then + echo "Sending messages to ntfy.sh" + MESSAGE="$msg"$'\n'"Timestamp: $timestamp" + curl -H "Icon: https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Revanced-logo-round.svg/240px-Revanced-logo-round.svg.png" \ + -H "Title: ⚙⚙⚙ ReVanced Build ⚙⚙⚙" \ + -d "$MESSAGE" \ + "$NTFY_URL/$NTFY_TOPIC" + MESSAGE="An update of microg was published." + [ $microg_updated ] && curl -H "Icon: https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Revanced-logo-round.svg/240px-Revanced-logo-round.svg.png" \ + -H "Title: ⚙⚙⚙ ReVanced Build ⚙⚙⚙" \ + -d "$MESSAGE" \ + "$NTFY_URL/$NTFY_TOPIC" +fi + # Do some cleanup, keep only the last 3 build's worth of files and a week worth of logs mkdir -p archive mv *ReVanced_*_$timestamp.apk archive/ diff --git a/build_settings b/build_settings index c835be8..753867c 100644 --- a/build_settings +++ b/build_settings @@ -28,3 +28,10 @@ CHANNEL_ADDRESS="" GOTIFY_NOTIFICATIONS=false GOTIFY_URL="https://push.example.com" GOTIFY_TOKEN="" + +# Settings for sending ntfy.sh notifications +# In case you decide to use it, please put valid config in the +# URL and TOPIC fields +NTFY_NOTIFICATIONS=false +NTFY_URL="https://ntfy.sh" +NTFY_TOPIC=""