]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/rc.d/helper/getdnsfromdhcpc.pl
3 # Helper program to get DNS info from dhcpc .info file.
5 # (c) Lawrence Manning, 2001
8 require 'CONFIG_ROOT/general-functions.pl';
11 my ($dhcp, $dns, @alldns, %dhcpc);
13 if ($count eq "" || $count < 1) {
14 die "Bad DNS number given"; }
16 if (open(FILE
, "${General::swroot}/red/iface")) {
20 if (!&General
::readhash
("${General::swroot}/dhcpc/dhcpcd-$iface.info", \
%dhcpc)) {
21 die "Could not open dhcpc info file";
24 die "Could not open interface file";
30 @alldns = split(',', $dns);
32 print "$alldns[$count - 1]\n";