Add misc/fixes

Includes bot alert and misc files in /tmp/tmp
This commit is contained in:
Monocots 2021-06-09 02:10:42 +00:00
parent 4f5669d436
commit 4736d7739b
4 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,24 @@
#!/bin/bash
# Send an Alert via IM system
rawurlencode() {
local string="${@}"
local strlen=${#string}
local encoded=""
local pos c o
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
_ALERT="${encoded}"
}
rawurlencode $@
curl -s "<%= @bot_alert_url %>$_ALERT"