Compare commits

...

2 Commits

Author SHA1 Message Date
user2
17b22daabc commit 2023-11-18 20:12:25 +00:00
a31
bff7d0ec1e Update stdin2discord.bash
All checks were successful
Push commit / report (push) Successful in 6s
2023-11-18 23:12:18 +03:00
2 changed files with 31 additions and 30 deletions

View File

@ -324,7 +324,7 @@ EINGLÜCKSFÄNGER,Close Encounters Corps,SCEC
Eisem,Не состою (Not in a squadron),N/A
EkzekutorGraz,Royal Phoenix Security Group,RPSG
El Mario,Не состою (Not in a squadron),N/A
EL1GE,TEACOFFE DISCOVERY,N/A
EL1GE,Teacoffe Discovery,N/A
eLCy,Close Encounters Corps,SCEC
Elfairiwen,Close Encounters Corps,SCEC
ELITYRA,Не состою (Not in a squadron),N/A

1 CMDR Squadron SQID
324 Eisem Не состою (Not in a squadron) N/A
325 EkzekutorGraz Royal Phoenix Security Group RPSG
326 El Mario Не состою (Not in a squadron) N/A
327 EL1GE TEACOFFE DISCOVERY Teacoffe Discovery N/A
328 eLCy Close Encounters Corps SCEC
329 Elfairiwen Close Encounters Corps SCEC
330 ELITYRA Не состою (Not in a squadron) N/A

View File

@ -1,29 +1,30 @@
#!/bin/bash
set -e
send() {
local _msg=$1
if [[ -z $_msg ]]; then
return
fi
curl -X POST \
-H "Content-Type: application/json" \
-d "{\"content\":\"\`\`\`diff\n$_msg\`\`\`\"}" \
"$DISCORD_WEBHOOK"
}
msg=""
while IFS= read -r line; do
line="$(sed 's@"@\\"@g' <<< "$line")" # Json screening
len="$(wc -m <<< "$msg$line")"
if [[ $len -ge 1985 ]]; then
send "$msg"
msg="$line"
else
msg+="$line\\n"
fi
done
send "$msg"
#!/bin/bash
set -e
set -x
send() {
local _msg=$1
if [[ -z $_msg ]]; then
return
fi
curl -X POST \
-H "Content-Type: application/json" \
-d "{\"content\":\"\`\`\`diff\n$_msg\`\`\`\"}" \
"$DISCORD_WEBHOOK"
}
msg=""
while IFS= read -r line; do
line="$(sed 's@"@\\"@g' <<< "$line")" # Json screening
len="$(wc -m <<< "$msg$line")"
if [[ $len -ge 1985 ]]; then
send "$msg"
msg="$line"
else
msg+="$line\\n"
fi
done
send "$msg"