1 files changed, 4 insertions(+), 8 deletions(-)
M lib/text.sh
M lib/text.sh => lib/text.sh +4 -8
@@ 3,17 3,13 @@
recieving() {
. ./.secrets
- mkfifo /tmp/xmpp
RECIEVE_ME="TESTDATA - Testing plain text at $(date)"
- xmppipe --chat "$PHONE_NUM@cheogram.com" <> /tmp/xmpp > /tmp/outdata
- echo "$RECIEVE_ME" > /tmp/xmpp
+ echo "$RECIEVE_ME" | go-sendxmpp "$PHONE_NUM@cheogram.com"
- sleep 30s
+ sleep 4s
RECIEVED="$(tail -n 2 "$XDG_DATA_HOME/sxmo/modem/$CHEOGRAM_NUM/sms.txt" | grep -v "^$")"
- [ "$RECIEVE_ME" = "$RECIEVED" ] && echo "Good"
- [ "$RECIEVE_ME" != "$RECIEVED" ] && echo "Bad"
+ [ "$RECIEVE_ME" = "$RECIEVED" ] && echo "Good" && return 0
+ [ "$RECIEVE_ME" != "$RECIEVED" ] && echo "Bad" && return 1
- rm /tmp/xmpp
- rm /tmp/outdata
}