From: Michael Prokop Date: Fri, 7 May 2021 15:04:43 +0000 (+0200) Subject: Drop deprecated /etc/dhcp3 and ship as /etc/dhcp only X-Git-Tag: v0.20.0~5 X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=b5b129632d65e8489851bf444e48daadcab344a4 Drop deprecated /etc/dhcp3 and ship as /etc/dhcp only The /etc/dhcp3/* files are deprecated since 2012, time to pull the plug :) Also see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673029 Now we only ship it as /etc/dhcp/dhclient-exit-hooks.d/grml-sethostname --- diff --git a/debian/grml-autoconfig.lintian-overrides b/debian/grml-autoconfig.lintian-overrides index 17a6cec..49829d8 100644 --- a/debian/grml-autoconfig.lintian-overrides +++ b/debian/grml-autoconfig.lintian-overrides @@ -7,3 +7,5 @@ grml-autoconfig: init.d-script-does-not-source-init-functions etc/init.d/grml-au grml-autoconfig: systemd-service-file-refers-to-unusual-wantedby-target lib/systemd/system/grml-autoconfig.service grml-boot.target # we have no better way yet grml-autoconfig: systemd-service-file-wraps-init-script lib/systemd/system/grml-autoconfig.service ExecStart +# that's the way dhclient hook scripts are working +grml-autoconfig: executable-not-elf-or-script etc/dhcp/dhclient-exit-hooks.d/grml-sethostname diff --git a/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname b/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname deleted file mode 120000 index 36cd991..0000000 --- a/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname +++ /dev/null @@ -1 +0,0 @@ -../../dhcp3/dhclient-exit-hooks.d/grml-sethostname \ No newline at end of file diff --git a/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname b/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname new file mode 100755 index 0000000..acd03a2 --- /dev/null +++ b/etc/dhcp/dhclient-exit-hooks.d/grml-sethostname @@ -0,0 +1,12 @@ +# only run the comamnd if we bound to a new ip +case "$reason" in BOUND) +if ! grep -q 'nodhcphostname' /proc/cmdline && [ -f /etc/grml_cd ] ; then + + hostname=$(busybox nslookup "$new_ip_address" | awk '/Address 1: '$new_ip_address'/ {print $4}') + if [ -n "$hostname" ] ; then + grml-hostname "$hostname" + hostname -F /etc/hostname + fi +fi +;; +esac diff --git a/etc/dhcp3/dhclient-exit-hooks.d/grml-sethostname b/etc/dhcp3/dhclient-exit-hooks.d/grml-sethostname deleted file mode 100755 index acd03a2..0000000 --- a/etc/dhcp3/dhclient-exit-hooks.d/grml-sethostname +++ /dev/null @@ -1,12 +0,0 @@ -# only run the comamnd if we bound to a new ip -case "$reason" in BOUND) -if ! grep -q 'nodhcphostname' /proc/cmdline && [ -f /etc/grml_cd ] ; then - - hostname=$(busybox nslookup "$new_ip_address" | awk '/Address 1: '$new_ip_address'/ {print $4}') - if [ -n "$hostname" ] ; then - grml-hostname "$hostname" - hostname -F /etc/hostname - fi -fi -;; -esac