aboutsummaryrefslogtreecommitdiff
path: root/scripts/detect-leak
blob: 35a5e0fe715d511abd6abe6500e34b5b9ccb4345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

for f in "$@"; do
	if ! printf "%s" "$f" | grep -q test; then
		continue
	fi

	if ! grep -q '\\Datum' "$f"; then
		continue
	fi

	datum="$(sed -n -r -e 's/\\Datum\{([[:digit:]]{2})\.([[:digit:]]{2})\.([[:digit:]]{4})\}/\3-\2-\1/p' "$f")"
	today="$(date +%s)"
	if [ "$(date -d"${datum}" +%s)" -gt "${today}" ]; then
		echo Test "${f}" am "${datum}" liegt in der Zukunft >&2
		exit 1
	fi
done