Remove building with NOCRYPTO option
[minix3.git] / external / bsd / dhcpcd / dist / dhcpcd-hooks / 15-timezone
blob606625ac92ac44a74482aedcaf5680e0ac375e69
1 # $NetBSD: 15-timezone,v 1.6 2014/11/07 20:51:03 roy Exp $
3 # Configure timezone
5 : ${localtime:=/etc/localtime}
7 set_zoneinfo()
9         local zoneinfo_dir= zone_file=
11         [ -z "$new_tzdb_timezone" ] && return 0
13         for d in \
14                 /usr/share/zoneinfo     \
15                 /usr/lib/zoneinfo       \
16                 /var/share/zoneinfo     \
17                 /var/zoneinfo           \
18         ; do
19                 if [ -d "$d" ]; then
20                         zoneinfo_dir="$d"
21                         break
22                 fi
23         done
25         if [ -z "$zoneinfo_dir" ]; then
26                 syslog warning "timezone directory not found"
27                 return 1
28         fi
30         zone_file="$zoneinfo_dir/$new_tzdb_timezone"
31         if [ ! -e "$zone_file" ]; then
32                 syslog warning "no timezone definition for $new_tzdb_timezone"
33                 return 1
34         fi
36         if copy_file "$zone_file" "$localtime"; then
37                 syslog info "timezone changed to $new_tzdb_timezone"
38         fi
41 # For ease of use, map DHCP6 names onto our DHCP4 names
42 case "$reason" in
43 BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
44         new_tzdb_timezone="$new_dhcp6_tzdb_timezone"
45         ;;
46 esac
48 if $if_up; then
49         set_zoneinfo