33 lines
573 B
Bash
Executable file
33 lines
573 B
Bash
Executable file
#!/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
|