First commit
This commit is contained in:
parent
675347dbed
commit
73fef605a5
|
@ -1,3 +1,7 @@
|
|||
# badgy
|
||||
|
||||
Very simple ninebadge shell client
|
||||
Very simple ninebadge shell client
|
||||
|
||||
# Depends
|
||||
|
||||
This works with "curlie" (https://curlie.io)
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
CURLIE="curlie -I"
|
||||
|
||||
clockin()
|
||||
{
|
||||
${CURLIE} POST ${BADGEURL}/clockin key=${KEY}
|
||||
}
|
||||
|
||||
clockout()
|
||||
{
|
||||
${CURLIE} POST ${BADGEURL}/clockout key=${KEY}
|
||||
}
|
||||
|
||||
validate()
|
||||
{
|
||||
${CURLIE} POST ${BADGEURL}/validate key=${KEY} dateof=$(date +'%Y-%m-%d')
|
||||
}
|
||||
|
||||
devalidate()
|
||||
{
|
||||
${CURLIE} POST ${BADGEURL}/devalidate key=${KEY} dateof=$(date +'%Y-%m-%d')
|
||||
}
|
||||
|
||||
|
||||
show()
|
||||
{
|
||||
${CURLIE} -I POST ${BADGEURL}/showtimers key=${KEY} dateof=$(date +'%Y-%m-%d')
|
||||
}
|
||||
|
||||
if [ -e "${HOME}/.badgyrc" ]; then
|
||||
. ${HOME}/.badgyrc
|
||||
else
|
||||
echo "${HOME}/.badgyrc file is missing, I need it"
|
||||
echo "Create it with this command:"
|
||||
echo " echo 'BADGEURL="https://myninebage" KEY="XXXX-XX-XXX-XXX"' > ${HOME}/.badyrc"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo `${1}` 2>/dev/null | jq
|
Loading…
Reference in New Issue