Server IP : 127.0.0.2 / Your IP : 3.133.100.106 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /etc/dhcp/dhclient-enter-hooks.d/ |
Upload File : |
# # 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 ] ; 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 N 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 N in $new_domain_name_servers ; do R="${R}nameserver $N " 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 N local N_LOW local ZONE_ID R="" if [ "$new_dhcp6_name_servers" ] && [ "$new_dhcp6_domain_search" ] ; then R="${R}search $new_dhcp6_domain_search " fi for N in $new_dhcp6_name_servers ; do # If the nameserver has a link-local address # then add a zone ID (interface name) to it. N_LOW="$(echo "$N" | tr '[:upper:]' '[:lower:]')" if expr "$N_LOW" : ^fe80:: >/dev/null ; then ZONE_ID="%$interface" else ZONE_ID="" fi R="${R}nameserver $N$ZONE_ID " done [ ! "$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