[c5c522c] | 1 | #!/bin/sh |
---|
| 2 | # Copyright 2000, 2001, 2006, 2007, 2008, 2012 Patrick J. Volkerding, Sebeka, MN, USA. |
---|
| 3 | # All rights reserved. |
---|
| 4 | # |
---|
| 5 | # Redistribution and use of this script, with or without modification, is |
---|
| 6 | # permitted provided that the following conditions are met: |
---|
| 7 | # |
---|
| 8 | # 1. Redistributions of this script must retain the above copyright |
---|
| 9 | # notice, this list of conditions and the following disclaimer. |
---|
| 10 | # |
---|
| 11 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
| 12 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 13 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
---|
| 14 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 15 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 16 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
| 17 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
| 18 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
| 19 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
| 20 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 21 | # |
---|
| 22 | |
---|
| 23 | if [ ! "$(basename "$1")" = "zoneinfo" -o ! -d "$1" ]; then |
---|
| 24 | echo " Usage: output-updated-timeconfig.sh <zoneinfo directory>" |
---|
| 25 | exit 1 |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | CWD=$(pwd) |
---|
| 29 | cat $CWD/parts/00 |
---|
| 30 | # Sorry, I'd rather not be US-centric but some people here have a hard |
---|
| 31 | # time finding things. ;-) |
---|
| 32 | ( cd $1 |
---|
| 33 | find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep "^US/" | while read zone ; do |
---|
| 34 | echo "\"${zone}\" \" \" \\" |
---|
| 35 | done |
---|
| 36 | ) |
---|
| 37 | ( cd $1 |
---|
| 38 | find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep -v "^US/" | while read zone ; do |
---|
| 39 | echo "\"${zone}\" \" \" \\" |
---|
| 40 | done |
---|
| 41 | ) |
---|
| 42 | cat $CWD/parts/02 |
---|
| 43 | ( cd $1 |
---|
| 44 | find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep "^US/" | while read zone ; do |
---|
| 45 | echo "${zone}" |
---|
| 46 | done |
---|
| 47 | ) |
---|
| 48 | ( cd $1 |
---|
| 49 | find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep -v "^US/" | while read zone ; do |
---|
| 50 | echo "${zone}" |
---|
| 51 | done |
---|
| 52 | ) |
---|
| 53 | cat $CWD/parts/04 |
---|