HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //usr/syno/lib/systemd/scripts/dhclient.sh
#!/bin/bash
action=$1
shift;
IFACE=$1
case "$action" in
pre-start)
	# For support #1282570, #1178031 and #752074
	# In case rtc get wrong system time less than 1970/01/01 cause dhclient abort
	year=$(date +%Y)
	if [ "$year" -lt 1970 ]; then
		date -s "2018/01/01" || true
	fi

	if [ -f /etc/dhclient/ipv4/dhcpv4.leases.$IFACE ]; then
		cp -f /etc/dhclient/ipv4/dhcpv4.leases.$IFACE /tmp/dhcpv4.leases.$IFACE
	fi
	;;
post-stop)
	/usr/bin/logger -t dhcp-client -p err "stopped on $IFACE" || true
	if [ -f /tmp/dhcpv4.leases.$IFACE ]; then
		cp -f /tmp/dhcpv4.leases.$IFACE /etc/dhclient/ipv4/dhcpv4.leases.$IFACE
    fi
	;;
esac