dots/.local/share/task/hooks/on-add.sync

26 lines
363 B
Plaintext
Raw Normal View History

2023-04-14 17:34:14 +02:00
#!/bin/sh
# Inspired by https://gist.github.com/primeapple/d3d82fbd28e9134d24819dd72430888e
2023-05-19 18:26:26 +02:00
read new_task
2023-04-14 17:34:14 +02:00
source ~/.env
2023-05-19 18:26:26 +02:00
log_file=./sync.log
2023-04-14 17:34:14 +02:00
is_up() {
if ! nc -z $TASKD_SERVER $TASKD_PORT; then
echo "Server is down" >> $log_file
exit 1
fi
}
is_up
date > $log_file
task rc.verbose:nothing sync >> $log_file &
2023-05-19 18:26:26 +02:00
echo $new_task
echo 'on-add'
2023-04-14 17:34:14 +02:00
exit 0