K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / etc / dhcp / dhclient-enter-hooks.d /
server ip : 172.67.156.115

your ip : 172.69.214.80

H O M E


Filename/etc/dhcp/dhclient-enter-hooks.d/resolvconf
Size2.78 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:50
Last modified14-Dec-2012 02:27
Last accessed08-Jul-2025 15:25
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#
# Script fragment to make dhclient supply nameserver information to resolvconf
#

# Tips:
# * Be careful about changing the environment since this is sourced
# * This script fragment uses bash features
# * As of isc-dhcp-client 4.2 the "reason" (for running the script) can be one of the following.
# (Listed on man page:) MEDIUM(0) PREINIT(0) BOUND(M) RENEW(M) REBIND(M) REBOOT(M) EXPIRE(D) FAIL(D) RELEASE(D) STOP(D) NBI(-) TIMEOUT(M)
# (Also used in master script:) ARPCHECK(0), ARPSEND(0)
# (Also used in master script:) PREINIT6(0) BOUND6(M) RENEW6(M) REBIND6(M) DEPREF6(0) EXPIRE6(D) RELEASE6(D) STOP6(D)
# (0) = master script does not run make_resolv_conf
# (M) = master script runs make_resolv_conf
# (D) = master script downs interface
# (-) = master script does nothing with this

if [ -x /sbin/resolvconf ] && [ -L /etc/resolv.conf ]; then
# For safety, first undefine the nasty default make_resolv_conf()
make_resolv_conf() { : ; }
case "$reason" in
BOUND|RENEW|REBIND|REBOOT|TIMEOUT)
# Define a resolvconf-compatible m_r_c() function
# It gets run later (or, in the TIMEOUT case, MAY get run later)
make_resolv_conf() {
local R
local nameserver
R=""
if [ "$new_domain_name_servers" ] && [ "$new_domain_name" ] ; then
R="${R}domain $new_domain_name
"
fi
if [ "$new_domain_name_servers" ] && [ "$new_domain_search" ] ; then
R="${R}search $new_domain_search
"
fi
for nameserver in $new_domain_name_servers ; do
R="${R}nameserver $nameserver
"
done
[ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.dhclient"
}
;;
BOUND6|RENEW6|REBIND6)
# Define a resolvconf-compatible m_r_c() function
# It gets run later (or, in the TIMEOUT case, MAY get run later)
make_resolv_conf() {
local R
local nameserver
local zone_id
R=""
if [ "$new_dhcp6_name_servers" ] && [ "$new_dhcp6_domain_search" ] ; then
R="${R}search $new_dhcp6_domain_search
"
fi
shopt -s nocasematch
for nameserver in $new_dhcp6_name_servers ; do

# If the nameserver has a link-local address
# then add a zone ID (interface name) to it.
if [[ "$nameserver" =~ ^fe80:: ]] ; then
zone_id="%$interface"
else
zone_id=""
fi
R="${R}nameserver $nameserver$zone_id
"
done
shopt -u nocasematch
[ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.ip6.dhclient"
}
;;
EXPIRE|FAIL|RELEASE|STOP)
# Delete resolv.conf info
[ ! "$interface" ] || /sbin/resolvconf -d "${interface}.dhclient"
;;
EXPIRE6|RELEASE6|STOP6)
# Delete resolv.conf info
[ ! "$interface" ] || /sbin/resolvconf -d "${interface}.ip6.dhclient"
;;
esac
fi