-
Notifications
You must be signed in to change notification settings - Fork 22
/
sync.sh
executable file
·44 lines (35 loc) · 1.07 KB
/
sync.sh
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
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
## EXPORTED IN entry.sh
#TO=
## SET IN ENVIRONMENT VARIABLES
#BIND_ADDRESS=
#TSUMUGU_MAXDELETE=
#TSUMUGU_TIMEZONEFILE=
#TSUMUGU_EXCLUDE=
#TSUMUGU_USERAGENT=
#TSUMUGU_PARSER=
#TSUMUGU_THREADS=
#TSUMUGU_EXTRA=
set -eu
[[ $DEBUG = true ]] && set -x
BIND_ADDRESS=${BIND_ADDRESS:-}
TSUMUGU_MAXDELETE=${TSUMUGU_MAXDELETE:-1000}
TSUMUGU_TIMEZONEFILE=${TSUMUGU_TIMEZONEFILE:-}
TSUMUGU_EXCLUDE=${TSUMUGU_EXCLUDE:-}
TSUMUGU_USERAGENT=${TSUMUGU_USERAGENT:-"Tsumugu HTTP Syncing Tool/"$(tsumugu --version | tail -n1 | cut -d' ' -f2)}
TSUMUGU_PARSER=${TSUMUGU_PARSER:-"nginx"}
TSUMUGU_THREADS=${TSUMUGU_THREADS:-"2"}
TSUMUGU_EXTRA=${TSUMUGU_EXTRA:-}
if [[ -n $TSUMUGU_TIMEZONEFILE ]]; then
TSUMUGU_TIMEZONEFILE="--timezone-file $TSUMUGU_TIMEZONEFILE"
fi
if [[ $DEBUG = true ]]; then
export RUST_LOG="tsumugu=debug"
fi
export NO_COLOR=1
exec tsumugu sync $TSUMUGU_TIMEZONEFILE \
--user-agent "$TSUMUGU_USERAGENT" \
--max-delete "$TSUMUGU_MAXDELETE" \
--parser "$TSUMUGU_PARSER" \
--threads "$TSUMUGU_THREADS" \
$TSUMUGU_EXCLUDE $TSUMUGU_EXTRA "$UPSTREAM" "$TO"