Fix breaking login issue
This commit is contained in:
parent
302bb7f631
commit
4be51f12e2
1 changed files with 8 additions and 6 deletions
14
matrix-send
14
matrix-send
|
@ -68,7 +68,7 @@ Username () {
|
|||
}
|
||||
|
||||
Password () {
|
||||
[ -z $1 ] && conf_error "No argument for directive Password"
|
||||
[ -z $1 ] && conf_error "No argument(s) for directive Password"
|
||||
password="$@"
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ CacheLocation () {
|
|||
|
||||
DefaultEvent () {
|
||||
[ -z $1 ] && conf_error "No argument for directive DefaultEvent"
|
||||
if vargrep "m\.(text|notice)" "$1" -Eo
|
||||
if vargrep "m\.(text|notice)" "$1" -Eq
|
||||
then defaultevent="$1"
|
||||
else conf_error "Invalid default event type"; fi
|
||||
}
|
||||
|
@ -130,6 +130,9 @@ ClearCache () {
|
|||
|
||||
Send () {
|
||||
curl -s -XPOST -d "{"'"'"msgtype"'"'":"'"'"$mtype"'"'", "'"'"body"'"'":"'"'"$message"'"'"}" "https://$server/_matrix/client/r0/rooms/%21$roomid/send/m.room.message?access_token=$token"
|
||||
#cat <<EOF
|
||||
#"{"'"'"msgtype"'"'":"'"'"$mtype"'"'", "'"'"body"'"'":"'"'"$message"'"'"}" "https://$server/_matrix/client/r0/rooms/%21$roomid/send/m.room.message?access_token=$token"
|
||||
#EOF
|
||||
}
|
||||
|
||||
########################
|
||||
|
@ -137,12 +140,14 @@ Send () {
|
|||
########################
|
||||
|
||||
[ -e /usr/local/bin/curl ] || [ -e /usr/bin/curl ] || error "curl not found"
|
||||
CacheLocation "$HOME/.cache"
|
||||
|
||||
[ -z "$1" ] && usage
|
||||
while getopts :t:chV opt
|
||||
do
|
||||
case $opt in
|
||||
t)
|
||||
if vargrep "m\.(text|notice)" "$OPTARG" -Eo
|
||||
if vargrep "m\.(text|notice)" "$OPTARG" -Eq
|
||||
then
|
||||
mtype="$OPTARG"
|
||||
optind="$OPTIND"
|
||||
|
@ -159,9 +164,6 @@ done
|
|||
#### Configuration loading ####
|
||||
###############################
|
||||
|
||||
# Set default config settings
|
||||
CacheLocation "$HOME/.cache"
|
||||
|
||||
# Load configuration
|
||||
if [ -e $HOME/.config/matrix-send.conf ];
|
||||
then . $HOME/.config/matrix-send.conf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue