Add files via upload
This commit is contained in:
parent
7d20baf07d
commit
6ec1d7eff4
3 changed files with 162 additions and 0 deletions
49
stepper.pl
Normal file
49
stepper.pl
Normal file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# step maker for bootup.pl
|
||||
|
||||
use Storable;
|
||||
|
||||
%steps = ();
|
||||
|
||||
open(steps,"<steps");
|
||||
@lines = <steps>;
|
||||
close steps;
|
||||
|
||||
# First item must be total number of steps
|
||||
|
||||
# each step consists of actions, can be multiple
|
||||
|
||||
foreach(@lines){
|
||||
|
||||
if($_ =~ /(step)/i){
|
||||
#print "New step number $sc\n";
|
||||
$sc++;
|
||||
$substep = 1;
|
||||
next;
|
||||
}else{
|
||||
@lp = split(/ /,$_);
|
||||
#print " Step num = $sc\n";
|
||||
for (my $i=1; $i <= scalar(@lp); $i++) {
|
||||
$cmd .= "@lp[$i] ";
|
||||
}
|
||||
#print "CMD = $cmd";
|
||||
$steps{$sc}{$substep}{@lp[0]} = $cmd;
|
||||
#print "LP = @lp\n";
|
||||
undef(@lp);
|
||||
undef($cmd);
|
||||
$substep++;
|
||||
}
|
||||
}
|
||||
|
||||
for $family ( keys %steps ) {
|
||||
#print "Step # $family: ";
|
||||
for $role ( keys %{ $steps{$family} } ) {
|
||||
for $exeord ( keys %{ $steps{$family}{$role}}){
|
||||
# print "sub hashex $exeord $role=$steps{$family}{$role}{$exeord} ";
|
||||
}
|
||||
#print "sub hash $role=$steps{$family}{$role} ";
|
||||
}
|
||||
# print "\n";
|
||||
}
|
||||
store \%steps, 'stpcomp';
|
Loading…
Add table
Add a link
Reference in a new issue