Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # /etc/ports/drivers/httpup: httpup driver script for ports(8) | |
4 | # | |
5 | ||
6 | if [ $# -ne 1 ]; then | |
7 | echo "usage: $0 <file>" >&2 | |
8 | exit 1 | |
9 | fi | |
10 | ||
11 | . $1 | |
12 | ||
13 | if [ -z "$ROOT_DIR" ]; then | |
14 | echo "ROOT_DIR not set in '$1'" >&2 | |
15 | exit 2 | |
16 | fi | |
17 | if [ -z "$URL" ]; then | |
18 | echo "URL not set in '$1'" >&2 | |
19 | exit 2 | |
20 | fi | |
21 | ||
22 | for REPO in $URL; do | |
23 | PORT=`echo $REPO | sed -n '/#.*$/s|^.*#||p'` | |
24 | httpup sync $REPO $ROOT_DIR/$PORT | |
25 | done | |
26 | ||
27 | # End of file. |