| 1 |
# |
| 2 |
# The purpose of this script is just to show the variables that are |
| 3 |
# available to all the scripts in this directory. All these scripts are |
| 4 |
# called from dhclient-script, which exports all the variables shown |
| 5 |
# before. If you want to debug a problem with your DHCP setup you can |
| 6 |
# enable this script and take a look at /tmp/dhclient-script.debug. |
| 7 |
|
| 8 |
# To enable this script set the following variable to "yes" |
| 9 |
RUN="no" |
| 10 |
|
| 11 |
if [ "$RUN" = "yes" ]; then |
| 12 |
echo "$(date): entering ${1%/*}, dumping variables." \ |
| 13 |
>> /tmp/dhclient-script.debug |
| 14 |
|
| 15 |
# loop over the 4 possible prefixes: (empty), cur_, new_, old_ |
| 16 |
for prefix in '' 'cur_' 'new_' 'old_'; do |
| 17 |
# loop over the DHCP variables passed to dhclient-script |
| 18 |
for basevar in reason interface medium alias_ip_address \ |
| 19 |
ip_address host_name network_number subnet_mask \ |
| 20 |
broadcast_address routers static_routes \ |
| 21 |
rfc3442_classless_static_routes \ |
| 22 |
domain_name domain_search domain_name_servers \ |
| 23 |
netbios_name_servers netbios_scope \ |
| 24 |
ntp_servers \ |
| 25 |
ip6_address ip6_prefix ip6_prefixlen \ |
| 26 |
dhcp6_domain_search dhcp6_name_servers ; do |
| 27 |
var="${prefix}${basevar}" |
| 28 |
eval "content=\$$var" |
| 29 |
|
| 30 |
# show only variables with values set |
| 31 |
if [ -n "${content}" ]; then |
| 32 |
echo "$var='${content}'" >> /tmp/dhclient-script.debug |
| 33 |
fi |
| 34 |
done |
| 35 |
done |
| 36 |
|
| 37 |
echo '--------------------------' >> /tmp/dhclient-script.debug |
| 38 |
fi |