Skip to content

Commit

Permalink
Use dhclient hooks instead of proprietary pump hooks for dhcphostname
Browse files Browse the repository at this point in the history
  • Loading branch information
mrud committed Dec 7, 2010
1 parent efc764b commit 8147fe1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 32 deletions.
3 changes: 1 addition & 2 deletions debian/rules
Expand Up @@ -30,7 +30,7 @@ install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs etc/grml etc/init.d usr/sbin usr/bin usr/share/doc/grml-saveconfig usr/lib/grml-autoconfig
dh_installdirs etc/grml etc/dhcp{3,}/dhclient-exit-hooks.d etc/init.d usr/sbin usr/bin usr/share/doc/grml-saveconfig

# Add here commands to install the package into debian/grml-autoconfig.
install -m 755 grml-autoconfig debian/grml-autoconfig/etc/init.d/grml-autoconfig
Expand All @@ -43,7 +43,6 @@ install: build

install -m 755 bin/restore-config debian/grml-autoconfig/usr/bin/restore-config
install -m 755 bin/save-config debian/grml-autoconfig/usr/bin/save-config
install -m 755 lib/pump-runparts debian/grml-autoconfig/usr/lib/grml-autoconfig/pump-runparts

# just as a "backup" solution:
cp -a etc/* debian/grml-autoconfig/etc/
Expand Down
1 change: 1 addition & 0 deletions etc/dhcp/dhclient-exit-hooks.d/grml-sethostname
12 changes: 12 additions & 0 deletions etc/dhcp3/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
21 changes: 0 additions & 21 deletions etc/grml/pump-scripts.d/set-hostname

This file was deleted.

9 changes: 0 additions & 9 deletions lib/pump-runparts

This file was deleted.

0 comments on commit 8147fe1

Please sign in to comment.