Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37572245
en ru br
ALT Linux repositórios
S:4.4.3.P1-alt1
5.0: 3.0.7-alt1
4.1: 3.0.6-alt2.M41.1
4.0: 3.0.6-alt1
3.0: 3.0.2-alt1

Group :: Sistema/Servidores
RPM: dhcp

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

#!/usr/bin/perl -W

#----------------------------------------------------------------------
# copyright (C) 2001 Florin Grad
#
# This is a really silly program that is supposed to allow an update of
# a dhcp-2* server to a dhcp-3* server
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#------------------------------------------------------------------------

#search for a ddns-update-style entry in /etc/dhcpd.conf file
my $conf_file = "/etc/dhcpd.conf"; #$ARGV[0];
my $conf_file_orig = "/etc/dhcpd.conf.orig";
my $i=0;
open (DHCPCONF, "< $conf_file") or die "Can't open the $conf_file file for reading";
while (<DHCPCONF>) {
if (/ddns-update-style/) {
$i++;
};
};
close (DHCPCONF);

if ($i == 0) { #we are on a dhcp-2
rename("$conf_file","$conf_file_orig") || die "Can't rename $conf_file: $!";
open (DHCPCONF, "> $conf_file") or die "Can't open the $conf_file file for writing";
print DHCPCONF "ddns-update-style none;\n";
open (DHCPCONF_ORIG, "< $conf_file_orig") or die "Can't open the $conf_file_orig file for reading";
while (<DHCPCONF_ORIG>) {
print DHCPCONF "$_";
};
close (DHCPCONF_ORIG);
close (DHCPCONF);
}
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009