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

27 lines
395 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 original_task
read modified_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 $modified_task
echo 'on-modify'
2023-04-14 17:34:14 +02:00
exit 0