Assembla home | Assembla project page
 

Changeset 20

Show
Ignore:
Timestamp:
11/06/07 23:20:09 (1 year ago)
Author:
major
Message:

* Added NetBSD support (thanks to Dave Burgess)
* Switched username/password prompts to STDERR so they won't appear in printouts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mysqltuner.pl

    r19 r20  
    88# Other Contributors: 
    99#       Paul Kehrer 
     10#   Dave Burgess 
    1011# 
    1112# This program is free software: you can redistribute it and/or modify 
     
    105106        $physical_memory = `sysctl -n hw.memsize`; 
    106107        $swap_memory = `sysctl -n vm.swapusage | awk '{print \$3}' | sed 's/\..*\$//'`; 
     108    } elsif ($os =~ /NetBSD/) { 
     109        $physical_memory = `sysctl -n hw.physmem`; 
     110        $swap_memory = `swapctl -l | grep '^/' | awk '{ s+= \$2 } END { print s }'`; 
    107111    } elsif ($os =~ /BSD/) { 
    108112        $physical_memory = `sysctl -n hw.realmem`; 
     
    147151            return 1; 
    148152        } else { 
    149             print "Please enter your MySQL login: "; 
     153            print STDERR "Please enter your MySQL login: "; 
    150154            my $name = <>; 
    151             print "Please enter your MySQL password: "; 
    152             system("stty -echo"); #don't show the password 
     155            print STDERR "Please enter your MySQL password: "; 
     156            system("stty -echo"); 
    153157            my $password = <>; 
    154             system("stty echo"); #plz give echo back 
     158            system("stty echo"); 
    155159            chomp($password); 
    156160            chomp($name); 
     
    159163            if ($loginstatus =~ /mysqld is alive/) { 
    160164                # Login was successful, but we won't say anything to save space 
    161                 print "\n"; 
     165                print STDERR "\n"; 
    162166                return 1; 
    163167            } else {