intake/demo/alice.sh

23 lines
646 B
Bash

#!/bin/sh
if [ -f /home/alice/.intake-setup-done ]; then
echo "already done"
exit 0
fi
mkdir -p $INTAKE_DATA_DIR
intake source add -s echo
intake action add -s echo -a fetch -- jq -cn '{id: env.ID, title: env.MESSAGE}'
intake source env -s echo --set "ID=hello"
intake source env -s echo --set "MESSAGE=Hello, world!"
intake channel add -s echo -c home
intake source add -s currenttime
intake action add -s currenttime -a fetch -- sh -c "date +%Y-%m-%d-%H-%M | jq -cR '{id: .}'"
intake source env -s currenttime --set "INTAKE_FETCH=every 1m"
intake channel add -s currenttime -c home
touch /home/alice/.intake-setup-done
echo "done"