David van Moolenbroek 9f20bfa6c4 Import NetBSD dhcpcd(8)
The port could be improved by adding support for pselect(2).

Other than that, this port has a few MINIX-specific changes:

- we undefine IN_IFF_ flags to stop dhcpcd from thinking that we have
  operating system support for link-local IPv4 address management;
- we work around one crash bug that seems triggered by using dhcpcd
  on some but not all interfaces;
- we add "noalias" to the default dhcpcd.conf(5) configuration file.

Change-Id: I8a81c2c2af353c5ce08335673b1ab2d4b39178da
2017-03-21 21:59:13 +00:00

51 lines
945 B
Plaintext

# $NetBSD: 15-timezone,v 1.6 2014/11/07 20:51:03 roy Exp $
# Configure timezone
: ${localtime:=/etc/localtime}
set_zoneinfo()
{
local zoneinfo_dir= zone_file=
[ -z "$new_tzdb_timezone" ] && return 0
for d in \
/usr/share/zoneinfo \
/usr/lib/zoneinfo \
/var/share/zoneinfo \
/var/zoneinfo \
; do
if [ -d "$d" ]; then
zoneinfo_dir="$d"
break
fi
done
if [ -z "$zoneinfo_dir" ]; then
syslog warning "timezone directory not found"
return 1
fi
zone_file="$zoneinfo_dir/$new_tzdb_timezone"
if [ ! -e "$zone_file" ]; then
syslog warning "no timezone definition for $new_tzdb_timezone"
return 1
fi
if copy_file "$zone_file" "$localtime"; then
syslog info "timezone changed to $new_tzdb_timezone"
fi
}
# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
new_tzdb_timezone="$new_dhcp6_tzdb_timezone"
;;
esac
if $if_up; then
set_zoneinfo
fi