mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Simplify and significantly speed up the timezone listing backend script.
Reviewed by: imp
This commit is contained in:
parent
161a621b47
commit
bb5c5f84fa
1 changed files with 4 additions and 13 deletions
|
|
@ -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…
Reference in a new issue