3 # $1 Calling circumstance (up, renewal, down)
7 # Exit early, if we're not being called for the initial lease
8 [ "$1" != "up" ] && exit 0
10 . /etc/grml/autoconfig.functions
13 # only run if no nodhcphostname parameter is given
14 if ! checkbootparam 'nodhcphostname' ; then
16 hostname=$(host $3) || exit 1
17 # dhcphostname is set, get the PTR for the ip
18 hostname=$(echo ${hostname} | awk '{ print substr($5, 0, length($5)-1) }')
20 if [ -n "$hostname" ] ; then
21 echo $hostname > /etc/hostname
22 hostname -F /etc/hostname