Subversion Repositories sysadmin_scripts

Rev

Rev 4 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 6
Line 4... Line 4...
4
# to a tab delimited text file on STDOUT.
4
# to a tab delimited text file on STDOUT.
5
 
5
 
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
 
8
 
-
 
9
use File::Spec; # find location of script so we can put storage in same directory
-
 
10
use File::Basename;
9
use YAML::Tiny; # apt-get libyaml-tiny-perl under debian
11
use YAML::Tiny; # apt-get libyaml-tiny-perl under debian
10
use POSIX qw( strftime ); # to convert timestamp to something readable
12
use POSIX qw( strftime ); # to convert timestamp to something readable
11
 
13
 
-
 
14
# where the script is located
-
 
15
my $scriptDir = dirname( File::Spec->rel2abs( __FILE__ ) );
-
 
16
# put the statefile in there
12
my $STATEFILE = 'mapSwitches.yaml';
17
my $STATEFILE = $scriptDir . '/mapSwitches.yaml';
13
 
18
 
14
my %switchports;
19
my %switchports;
15
 
20
 
16
# pretty up the MAC addresses by inserting colons between
21
# pretty up the MAC addresses by inserting colons between
17
# every pair of numbers
22
# every pair of numbers