Parcourir la source

fix(alert): resolve bug with telegram curlcustomstring error

I'm getting this error while trying to use `curlcustomstring="--socks5 192.168.191.1:6080"` as proxy: 
```shell
[ .... ] Alert tf2server: Sending Telegram alertcurl: option --socks5 192.168.191.1:6080 : is unknown
curl: try 'curl --help' or 'curl --manual' for more information
```
So I make a fix for it. As far as I'm concerned, if `curlcustomstring` contains multiple options it should not use that *quotes*.
RuioWolf il y a 6 ans
Parent
commit
147057e23a
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      lgsm/functions/alert_telegram.sh

+ 1 - 1
lgsm/functions/alert_telegram.sh

@@ -18,7 +18,7 @@ EOF
 )
 )
 
 
 fn_print_dots "Sending Telegram alert"
 fn_print_dots "Sending Telegram alert"
-telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" "${curlcustomstring}" | grep "error_code")
+telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code")
 
 
 if [ "${telegramsend}" ]; then
 if [ "${telegramsend}" ]; then
 	fn_print_fail_nl "Sending Telegram alert: ${telegramsend}"
 	fn_print_fail_nl "Sending Telegram alert: ${telegramsend}"