XylotrechusZ

XylotrechusZ Shell

: /home/matican/.acme.sh/notify/ [ drwxrwxr-x ]
Uname: Linux premium72.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.2.29 [ PHP INFO ] PHP os: Linux
Server Ip: 198.54.125.95
Your Ip: 216.73.216.35
User: matican (532) | Group: matican (531)
Safe Mode: OFF
Disable Function:
NONE

name : callmebotWhatsApp.sh
#!/bin/bash

#Support CallMeBot Whatsapp webhooks

#CALLMEBOT_YOUR_PHONE_NO=""
#CALLMEBOT_API_KEY=""

callmebotWhatsApp_send() {
  _subject="$1"
  _content="$2"
  _statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped
  _debug "_statusCode" "$_statusCode"

  CALLMEBOT_YOUR_PHONE_NO="${CALLMEBOT_YOUR_PHONE_NO:-$(_readaccountconf_mutable CALLMEBOT_YOUR_PHONE_NO)}"
  if [ -z "$CALLMEBOT_YOUR_PHONE_NO" ]; then
    CALLMEBOT_YOUR_PHONE_NO=""
    _err "You didn't specify a Slack webhook url CALLMEBOT_YOUR_PHONE_NO yet."
    return 1
  fi
  _saveaccountconf_mutable CALLMEBOT_YOUR_PHONE_NO "$CALLMEBOT_YOUR_PHONE_NO"

  CALLMEBOT_API_KEY="${CALLMEBOT_API_KEY:-$(_readaccountconf_mutable CALLMEBOT_API_KEY)}"
  if [ "$CALLMEBOT_API_KEY" ]; then
    _saveaccountconf_mutable CALLMEBOT_API_KEY "$CALLMEBOT_API_KEY"
  fi

  _waUrl="https://api.callmebot.com/whatsapp.php"

  _Phone_No="$(printf "%s" "$CALLMEBOT_YOUR_PHONE_NO" | _url_encode)"
  _apikey="$(printf "%s" "$CALLMEBOT_API_KEY" | _url_encode)"
  _message="$(printf "*%s*\\n%s" "$_subject" "$_content" | _url_encode)"

  _finalUrl="$_waUrl?phone=$_Phone_No&apikey=$_apikey&text=$_message"
  response="$(_get "$_finalUrl")"

  if [ "$?" = "0" ] && _contains ".<p><b>Message queued.</b> You will receive it in a few seconds."; then
    _info "wa send success."
    return 0
  fi
  _err "wa send error."
  _debug "URL" "$_finalUrl"
  _debug "Response" "$response"
  return 1
}
© 2025 XylotrechusZ