Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /etc/dhcp/dhclient-exit-hooks.d/hostname
- <FILE>
- #!/bin/bash
- # Mava was hier
- if [ "$interface" != "eth0" ]
- then
- return
- fi
- if [ "$reason" != BOUND ] && [ "$reason" != RENEW ] \
- && [ "$reason" != REBIND ] && [ "$reason" != REBOOT ]
- then
- return
- fi
- #echo dhclient-exit-hooks.d/hostname: Dynamic IP address = $new_ip_address
- hostname=$(host $new_ip_address | cut -d ' ' -f 5)
- pure_host=$(host $hostname | cut -d '.' -f 1)
- echo $pure_host > /etc/hostname
- hostname $pure_host
- #hostname=$pure_host
- #echo $new_ip_address $hostname $pure_host >> /etc/hosts
- <EOF>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement