adding sops for taskchamp
This commit is contained in:
parent
408b7545e6
commit
65ca3ce463
2 changed files with 29 additions and 1 deletions
28
modules/home/taskwarrior/hooks/on-exit-sync.sh
Normal file
28
modules/home/taskwarrior/hooks/on-exit-sync.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
# This hooks script syncs task warrior to the configured task server.
|
||||
# The on-exit event is triggered once, after all processing is complete.
|
||||
|
||||
# Make sure hooks are enabled
|
||||
|
||||
check_for_internet() {
|
||||
# check for internet connectivity
|
||||
nc -z 8.8.8.8 53 >/dev/null 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Count the number of tasks modified
|
||||
n=0
|
||||
while read modified_task
|
||||
do
|
||||
n=$(($n + 1))
|
||||
done
|
||||
|
||||
if (($n > 0)); then
|
||||
check_for_internet
|
||||
date >> ~/.local/share/task/sync_hook.log
|
||||
task rc.verbose:nothing sync >> ~/.local/share/task/sync_hook.log &
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue