intake/demo/alice.sh

26 lines
737 B
Bash
Raw Normal View History

2025-02-12 21:58:37 +00:00
#!/bin/sh
if [ -f /home/alice/.intake-setup-done ]; then
echo "already done"
exit 0
fi
# intake service gets a crontab wrapper, cheat here
export PATH="/run/wrappers/bin:$PATH"
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_CRON=* * * * *"
intake channel add -s currenttime -c home
touch /home/alice/.intake-setup-done
echo "done"