Simplify and significantly speed up the timezone listing backend script.
Reviewed by: imp
This commit is contained in:
parent
161a621b47
commit
bb5c5f84fa
@ -25,19 +25,10 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
|
||||
|
||||
# Backend script which lists all the available timezones for front-ends to display
|
||||
while read line
|
||||
do
|
||||
echo "$line" | grep "^#" >/dev/null 2>/dev/null
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp
|
||||
fi
|
||||
done < /usr/share/zoneinfo/zone.tab
|
||||
|
||||
sort ${TMPDIR}/.tzonetmp
|
||||
rm -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
|
||||
egrep -v '^#' /usr/share/zoneinfo/zone.tab |\
|
||||
tr -s "\t" ":" |\
|
||||
cut -d ":" -f 3-4 |\
|
||||
sort
|
||||
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user