summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakTermServ
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-10 00:54:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-10 00:54:27 +0000
commit3567c50a33be996d7a3f4fd6c622622105d55a51 (patch)
tree525589a2426f64fc2d1b9e8fe00b58c31bced634 /perl-install/standalone/drakTermServ
parent24267eb313f4272a92e0909ca47a831f7ce047c0 (diff)
downloaddrakx-backup-do-not-use-3567c50a33be996d7a3f4fd6c622622105d55a51.tar
drakx-backup-do-not-use-3567c50a33be996d7a3f4fd6c622622105d55a51.tar.gz
drakx-backup-do-not-use-3567c50a33be996d7a3f4fd6c622622105d55a51.tar.bz2
drakx-backup-do-not-use-3567c50a33be996d7a3f4fd6c622622105d55a51.tar.xz
drakx-backup-do-not-use-3567c50a33be996d7a3f4fd6c622622105d55a51.zip
minimal perl_checker fixes to have only warnings
Diffstat (limited to 'perl-install/standalone/drakTermServ')
-rwxr-xr-xperl-install/standalone/drakTermServ18
1 files changed, 7 insertions, 11 deletions
diff --git a/perl-install/standalone/drakTermServ b/perl-install/standalone/drakTermServ
index cef0b2a58..d5cfa9b6b 100755
--- a/perl-install/standalone/drakTermServ
+++ b/perl-install/standalone/drakTermServ
@@ -140,7 +140,7 @@ interactive_mode() if $#ARGV < 1;
sub read_conf_file {
if (-e $cfg_file) {
- open (CONF_FILE, "<" . $cfg_file) || print "You must be root to read configuration file. \n";
+ open(CONF_FILE, "<" . $cfg_file) || print "You must be root to read configuration file. \n";
while (<CONF_FILE>) {
next unless /\S/;
next if /^#/;
@@ -456,7 +456,7 @@ sub help {
A basic example of creating a boot floppy for a 3Com 3c509 manually:
- cat /usr/lib/etherboot/boot1a.bin /\
+ cat /usr/lib/etherboot/boot1a.bin \\
/usr/lib/etherboot/lzrom/3c509.lzrom > /dev/fd0
@@ -1325,7 +1325,6 @@ sub deluser {
# del a user from the shadow$$CLIENT$$ file
my ($cmd_line, $username) = @_;
my $i;
- my $user;
my $user_deleted;
my @ts_users = cat_("/etc/shadow\$\$CLIENT\$\$");
@@ -1333,7 +1332,7 @@ sub deluser {
if ($is_ts_user) {
$i = 0;
- foreach $user (@ts_users) {
+ foreach my $user (@ts_users) {
if ($user =~ /$username/) {
splice (@ts_users, $i, 1);
$user_deleted = 1;
@@ -1342,7 +1341,7 @@ sub deluser {
$i++;
}
open(FHANDLE, "> /etc/shadow\$\$CLIENT\$\$");
- foreach $user (@ts_users) {
+ foreach my $user (@ts_users) {
print FHANDLE "$user";
}
close FHANDLE;
@@ -1365,11 +1364,10 @@ sub addclient {
my $host_in_use = 0;
my $mac_in_use = 0;
my $ip_in_use = 0;
- my $client;
my %ts_clients = read_dhcpd_conf();
- foreach $client(keys(%ts_clients)){
+ foreach my $client(keys(%ts_clients)){
$host_in_use = 1 if ($hostname eq $client);
$mac_in_use = 1 if ($mac eq $ts_clients{$client}{hardware});
$ip_in_use = 1 if ($ip eq $ts_clients{$client}{address});
@@ -1406,12 +1404,11 @@ sub addclient {
sub delclient {
#- find a client and delete the entry in dhcpd.conf
my ($cmd_line, $hostname) = @_;
- my $client;
my $host_found;
my %ts_clients = read_dhcpd_conf();
- foreach $client(keys(%ts_clients)){
+ foreach my $client (keys(%ts_clients)){
if ($hostname eq $client) {
$host_found = 1;
delete $ts_clients{$client};
@@ -1500,10 +1497,9 @@ sub format_client_entry {
sub write_dhcpd_conf {
my %ts_clients = @_;
my $clients = "/etc/dhcpd.conf.etherboot.clients";
- my $key;
open(CLIENT, "> $clients") || warn ("Can't open $clients!");
- foreach $key(keys(%ts_clients)){
+ foreach my $key(keys(%ts_clients)){
my $client_entry = format_client_entry($key, %ts_clients);
print CLIENT $client_entry;
}