eureka/underbbs.sh

34 lines
573 B
Bash
Raw Normal View History

2024-09-27 01:32:04 +00:00
#!/bin/sh
. ~/.config/underbbs/cli
helpme() {
echo "later"
}
syndicate_honk() {
# authenticate to the honknet
local token=$(curl -X POST -F "username=${HONK_USERNAME}" -F "password=${HONK_PASSWORD}" -F "gettoken=1" ${HONK_URL}/dologin)
# it's gonna be honked
local result=$(curl -X POST -F "action=honk" -F "token=${token}" -F "noise=$@" ${HONK_URL}/api)
echo $result
}
if [ -z "$2" ]; then
helpme
exit
fi
adapter=$1
shift
case $adapter in
honk)
noise=$(echo "$@" | sed -e 's/|/\|/')
syndicate_honk "$noise"
;;
*)
helpme ;;
esac