esmp3/tools/create_tz_json.sh

15 lines
312 B
Bash
Raw Permalink Normal View History

#!/usr/bin/bash
URL="https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv"
(
first=1
echo "{\"timezones\": {"
curl --silent "$URL" | while read line; do
[ $first -ne 1 ] && echo ","
first=0
echo -n "${line/\",\"/\":\"}"
done
echo
echo "}}"
) > src/webinterface/timezones.json