better webhoo echo -e \nExisting Webhook and Tag found. Using those values unless you enter new ones.\n
This commit is contained in:
@@ -23,10 +23,11 @@ fi
|
||||
echo -e "\nConfigure Discord Webhook Settings"
|
||||
|
||||
if [ -f /tmp/tag.txt ] && [ -f /tmp/webhook.txt ]; then
|
||||
echo -e "\nExisting Webhook and Tag found. Using those values unless you enter new ones.\n"
|
||||
|
||||
existing_webhook=$(cat /tmp/webhook.txt)
|
||||
existing_tag=$(cat /tmp/tag.txt)
|
||||
|
||||
echo -e "\nExisting Webhook and Tag found. Using those values unless you enter new ones.\n"
|
||||
|
||||
echo -e "Existing Webhook URL: $existing_webhook"
|
||||
echo -e "Existing Tag: $existing_tag\n"
|
||||
|
||||
|
||||
+10
-1
@@ -1,7 +1,11 @@
|
||||
#!/bin/bash
|
||||
# usage: webhook [message/mode] [notify]
|
||||
## webhook bootup # for bootup mode
|
||||
## webhook "silly soemething" # for normal webhook message
|
||||
## webhook "silly osmething" true # to ping with normal message
|
||||
# usage in cron
|
||||
## @reboot bash /usr/share/customscripts/ifnet "/usr/share/customscripts/webhook bootup"
|
||||
# discord_webhook="https://discord.com/api/webhooks/yourwebhook"
|
||||
|
||||
discord_webhook=$(cat /usr/share/customscripts/webhook.txt)
|
||||
ipaddr=$(hostname -I | grep -E -o "10.0.0.[0-9]{1,3}" | tr '\n' ' ')
|
||||
date=$(date "+%d/%m/%Y %H:%M:%S %Z (%s)")
|
||||
@@ -19,6 +23,11 @@ else
|
||||
content="$1"
|
||||
fi
|
||||
|
||||
# any value in $2 will do ping mode
|
||||
if [ ! -z $2 ]; then
|
||||
content+="\n$tag"
|
||||
fi
|
||||
|
||||
post_data() {
|
||||
cat <<EOF
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user