]> git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/generate_zone_file_list.sh
system_cmds-790.20.2.tar.gz
[apple/system_cmds.git] / zic.tproj / generate_zone_file_list.sh
1 #!/bin/sh
2 set -e
3 set -x
4
5 # we need to know where the data files are...
6 if [ $# -ne 1 ]; then
7 echo "Usage: $0 DATA_FILES_DIR" 1>&2
8 exit 1
9 fi
10
11 DATFILES="$1"
12 ZONE_FILES="$(egrep --files-with-match '^(Zone|Rule|Link)' "${DATFILES}"/* | awk -F "/" '{print $NF}')"
13
14 for tz in ${ZONE_FILES}; do
15 if [ ${tz} = "backward" ]; then
16 DO_BACKWARD=1
17 continue
18 elif [ ${tz} = "backzone" ]; then
19 continue
20 else
21 echo "${tz}"
22 fi
23 done
24
25 if [ -n "$DO_BACKWARD" ]; then
26 echo "backward"
27 fi
28