• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/dhcp/dhclient-script
Gustavo ZacariasGustavo Zacarias committed 1cd15cb15a127 Nov 2014
Raw file
Source viewDiff to previous
 
1
#!/bin/sh
2
​
3
# dhclient-script from OpenWRT project
4
# http://git.openwrt.org/?p=packages.git;a=blob;f=net/isc-dhcp/files/dhclient-script;h=4afebc0ad20ebac51c5baae5ed01c6713e3a0fd0;hb=HEAD
5
​
6
make_resolv_conf() {
7
  if [ x"$new_domain_name_servers" != x ]; then
8
    cat /dev/null > /etc/resolv.conf.dhclient
9
    chmod 644 /etc/resolv.conf.dhclient
10
    if [ x"$new_domain_search" != x ]; then
11
      echo search $new_domain_search >> /etc/resolv.conf.dhclient
12
    elif [ x"$new_domain_name" != x ]; then
13
      # Note that the DHCP 'Domain Name Option' is really just a domain
14
      # name, and that this practice of using the domain name option as
15
      # a search path is both nonstandard and deprecated.
16
      echo search $new_domain_name >> /etc/resolv.conf.dhclient
17
    fi
18
    for nameserver in $new_domain_name_servers; do
19
      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
20
    done
21
​
22
  elif [ "x${new_dhcp6_name_servers}" != x ] ; then
23
    cat /dev/null > /etc/resolv.conf.dhclient6
24
    chmod 644 /etc/resolv.conf.dhclient6
25
​
26
    if [ "x${new_dhcp6_domain_search}" != x ] ; then
27
      echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
28
    fi
29
    for nameserver in ${new_dhcp6_name_servers} ; do
30
      echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
31
    done
32
  fi
33
​
34
  # if both v4 and v6 clients are running, concatenate results
35
  cat /etc/resolv.conf.* > /etc/resolv.conf
36
}
37
​
38
# Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
39
exit_with_hooks() {
40
  exit_status=$1
41
  if [ -f /etc/dhclient-exit-hooks ]; then
42
    . /etc/dhclient-exit-hooks
43
  fi
44
# probably should do something with exit status of the local script
45
  exit $exit_status
46
}
47
​
48
# Invoke the local dhcp client enter hooks, if they exist.
49
if [ -f /etc/dhclient-enter-hooks ]; then
50
  exit_status=0
51
  . /etc/dhclient-enter-hooks
52
  # allow the local script to abort processing of this state
53
  # local script must set exit_status variable to nonzero.
54
  if [ $exit_status -ne 0 ]; then
55
    exit $exit_status
56
  fi
57
fi
58
​
59
###
60
### DHCPv4 Handlers
61
###
62
​
63
if [ x$new_broadcast_address != x ]; then
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.