mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-26 23:11:44 +00:00
Update callmebotWhatsApp.sh
variable updated to caps
This commit is contained in:
parent
4381657c5e
commit
b5a7f46ecc
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#Support CallMeBot Whatsapp webhooks
|
#Support CallMeBot Whatsapp webhooks
|
||||||
|
|
||||||
#CallMeBot_Phone_No=""
|
#CALLMEBOT_YOUR_PHONE_NO=""
|
||||||
#CallMeBot_apikey=""
|
#CALLMEBOT_API_KEY=""
|
||||||
|
|
||||||
callmebotWhatsApp_send() {
|
callmebotWhatsApp_send() {
|
||||||
_subject="$1"
|
_subject="$1"
|
||||||
@ -11,23 +11,23 @@ callmebotWhatsApp_send() {
|
|||||||
_statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped
|
_statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped
|
||||||
_debug "_statusCode" "$_statusCode"
|
_debug "_statusCode" "$_statusCode"
|
||||||
|
|
||||||
CallMeBot_Phone_No="${CallMeBot_Phone_No:-$(_readaccountconf_mutable CallMeBot_Phone_No)}"
|
CALLMEBOT_YOUR_PHONE_NO="${CALLMEBOT_YOUR_PHONE_NO:-$(_readaccountconf_mutable CALLMEBOT_YOUR_PHONE_NO)}"
|
||||||
if [ -z "$CallMeBot_Phone_No" ]; then
|
if [ -z "$CALLMEBOT_YOUR_PHONE_NO" ]; then
|
||||||
CallMeBot_Phone_No=""
|
CALLMEBOT_YOUR_PHONE_NO=""
|
||||||
_err "You didn't specify a Slack webhook url CallMeBot_Phone_No yet."
|
_err "You didn't specify a Slack webhook url CALLMEBOT_YOUR_PHONE_NO yet."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
_saveaccountconf_mutable CallMeBot_Phone_No "$CallMeBot_Phone_No"
|
_saveaccountconf_mutable CALLMEBOT_YOUR_PHONE_NO "$CALLMEBOT_YOUR_PHONE_NO"
|
||||||
|
|
||||||
CallMeBot_apikey="${CallMeBot_apikey:-$(_readaccountconf_mutable CallMeBot_apikey)}"
|
CALLMEBOT_API_KEY="${CALLMEBOT_API_KEY:-$(_readaccountconf_mutable CALLMEBOT_API_KEY)}"
|
||||||
if [ -n "$CallMeBot_apikey" ]; then
|
if [ -n "$CALLMEBOT_API_KEY" ]; then
|
||||||
_saveaccountconf_mutable CallMeBot_apikey "$CallMeBot_apikey"
|
_saveaccountconf_mutable CALLMEBOT_API_KEY "$CALLMEBOT_API_KEY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_waUrl="https://api.callmebot.com/whatsapp.php"
|
_waUrl="https://api.callmebot.com/whatsapp.php"
|
||||||
|
|
||||||
_Phone_No="$(printf "%s" "$CallMeBot_Phone_No" | _url_encode)"
|
_Phone_No="$(printf "%s" "$CALLMEBOT_YOUR_PHONE_NO" | _url_encode)"
|
||||||
_apikey="$(printf "%s" "$CallMeBot_apikey" | _url_encode)"
|
_apikey="$(printf "%s" "$CALLMEBOT_API_KEY" | _url_encode)"
|
||||||
_message="$(printf "$CQHTTP_CUSTOM_MSGHEAD *%s*\\n%s" "$_subject" "$_content" | _url_encode)"
|
_message="$(printf "$CQHTTP_CUSTOM_MSGHEAD *%s*\\n%s" "$_subject" "$_content" | _url_encode)"
|
||||||
|
|
||||||
_finalUrl="$_waUrl?phone=$_Phone_No&apikey=$_apikey&text=$_message"
|
_finalUrl="$_waUrl?phone=$_Phone_No&apikey=$_apikey&text=$_message"
|
||||||
|
Loading…
Reference in New Issue
Block a user