/usr/lib/debian-edu-config/testsuite/timezone is in debian-edu-config 1.702.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #!/bin/sh -e
#
# Test if the timezone is correct.
if test -r /etc/debian-edu/config ; then
. /etc/debian-edu/config
fi
if [ ! -f /etc/localtime ] ; then
echo "error: $0: The file /etc/localtime is missing."
exit
fi
timezone="$(cat /etc/timezone)"
if [ -z "$timezone" ] ; then
echo "warning: No value in /etc/timezone."
fi
# Find the matching zonefile(s)
id=$(md5sum /etc/localtime | awk '{print $1}')
curzones=$(cd /usr/share/zoneinfo; find . -type f |xargs md5sum | grep $id |awk '{print $2}' | sed 's/\.\///')
map_locale_to_timezone() {
case "$1" in
*_BE*)
localzone="Europe/Brussels"
;;
*_BR*)
localzone="America/Sao_Paulo America/Noronha \
America/Belem America/Fortaleza \
America/Recife America/Araguaina \
America/Maceio America/Cuiaba \
America/Porto_Velho America/Boa_Vista \
America/Manaus America/Eirunepe \
America/Rio_Brancor"
;;
*_DE*)
localzone="Europe/Berlin"
;;
*_DK*)
localzone="Europe/Copenhagen"
;;
*_ES*)
localzone="Europe/Madrid"
;;
*_FI*)
localzone="Europe/Helsinki"
;;
*_FR*)
localzone="Europe/Paris"
;;
*_IT*)
localzone="Europe/Rome"
;;
*_LV*)
localzone="Europe/Riga"
;;
*_MX*)
localzone="America/Mexico_City America/Cancun America/Merida \
America/Monterrey America/Mazatlan America/Chihuahua \
America/Hermosillo America/Tijuana"
;;
*_NL*)
localzone="Europe/Amsterdam"
;;
*_NO*)
localzone="Europe/Oslo"
;;
*_PL*)
localzone="Europe/Warsaw"
;;
*_SE*)
localzone="Europe/Stockholm"
;;
*)
# Accept the existing value if the default language is unspecified
localzone="unknown";
;;
esac
# Convert newlines to spaces
localzone="$(echo $localzone)";
}
map_locale_to_timezone "$LOCALE"
foundZone=
for zone in $localzone; do
for curzone in $curzones ; do
if test "$curzone" = "$zone"; then
foundZone=$curzone
fi
done
done
if [ "$foundZone" ] ; then
echo "success: $0: Time zone is '$foundZone'."
else
if [ unknown = "$localzone" ] ; then
echo "warning: Correct time zone for locale '$LOCALE' is not known."
else
echo "error: $0: /etc/localtime is not equal to ($localzone), /etc/timezone is '$timezone'."
fi
fi
|