-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup-taskwarrior.sh
More file actions
executable file
·35 lines (28 loc) · 997 Bytes
/
setup-taskwarrior.sh
File metadata and controls
executable file
·35 lines (28 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -e
# set up an task warrior client to sync with the taskd.
# this is basically the description from
# https://taskwarrior.org/docs/taskserver/taskwarrior.html
::() {
echo ":: $*" >&2
"$@"
}
userkeyname=thorsten_wissmann
mkdir -p ~/.task
:: scp \
uber:~/taskd/$userkeyname.{cert,key}.pem \
uber:~/taskd/ca.cert.pem \
~/.task
:: task config taskd.certificate -- ~/.task/$userkeyname.cert.pem
:: task config taskd.key -- ~/.task/$userkeyname.key.pem
:: task config taskd.ca -- ~/.task/ca.cert.pem
server=$(ssh uber 'cat ~/taskd/config |grep ^server= |cut -d= -f2-')
:: task config taskd.server -- "$server"
# import the user
for c in $( ssh uber 'find ~/taskd/orgs -name config -printf "%P\n"') ; do
org="${c%%/*}"
id="${c#*/*/}"
id="${id%/*}"
fullname=$(ssh uber "grep ^user= ~/taskd/orgs/$c"|cut -d= -f2-)
echo "Set the users credentials via:"
echo "task config taskd.credentials -- \"$org/$fullname/$id\""
done