- Timestamp:
- May 21, 2006, 7:37:43 PM (19 years ago)
- Location:
- tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/FreeBSD5_x/g_list.pl
r5157 r5230 22 22 }; 23 23 24 sub filelist { 25 foreach $file ( sort @filelist) { 26 if( $HTML) { 27 print "$file<BR>\n"; 28 } 29 else { 30 print "$file\n"; 31 }; 32 }; 33 } 34 35 sub listnodes { 36 opendir(DIR, $ndir) || die "can't opendir $ndir: $!"; 37 @tmpdirs = grep { /^[^\.]/ && -d "$ndir/$_" } readdir(DIR); 38 closedir DIR; 39 foreach $dir (sort @tmpdirs) { 40 if( not exists($removefromnodelist{$dir}) ) 41 { 42 push(@nodelist, $dir); 43 } 44 else 45 { 46 if ( $debug ) { print "'$dir' removed from list\n"; } 47 } 48 }; 49 return @nodelist; 50 } 51 52 sub nodelist { 53 foreach $node (listnodes( )) { 54 if( $HTML) { 55 print "$node<BR>\n"; 56 } 57 else { 58 print "$node\n"; 59 }; 60 }; 61 } 24 62 25 63 #REQUEST parsen 26 64 $request=$ENV{'REQUEST_URI'}; 27 if( $request=~/ cgi-bin\/g_list.pl\/(.*)$/) {65 if( $request=~/.*g_list.pl\/(.*)$/) { 28 66 ($node,$file)=split(/\//,$1); 29 67 $title="$node $file"; 68 if ( $debug ) { print "Node: $node\n"; } 69 if ( $debug ) { print "File: $file\n"; } 30 70 } 31 71 else { … … 64 104 } 65 105 else { 66 g_list( ); 67 }; 106 g_list( ); 107 } 108 } 109 elsif( $node eq 'filelist' ) { 110 filelist( ); 111 } 112 elsif( $node eq 'nodelist' ) { 113 nodelist( ); 68 114 } 69 115 else { 70 116 if( $file eq '') { 71 foreach $file ( sort @filelist) { 72 if( $HTML) { 73 print "$file<BR>\n"; 74 } 75 else { 76 print "$file\n"; 77 }; 78 }; 117 filelist( ); 79 118 } 80 119 elsif( $file eq 'config') { … … 115 154 }; 116 155 117 opendir(DIR, $ndir) || die "can't opendir $ndir: $!"; 118 @dirs = grep { /^[^\.]/ && -d "$ndir/$_" } readdir(DIR); 119 closedir DIR; 156 @dirs = listnodes( ); 120 157 foreach $dir (sort @dirs) { 121 158 if( $dir=~/attic/ ) { -
tools/FreeBSD5_x/genesis.conf
r4981 r5230 21 21 $filelist[6]="txtconfig"; 22 22 $filelist[7]="authorized_keys"; 23 24 #Ignore this node diretories 25 %removefromnodelist = ( 26 'retired' => 'YES', 27 'obsolete' => 'YES', 28 ); 29 23 30 24 31 #(inter)net env -
tools/FreeBSD6_x/g_list.pl
r5157 r5230 22 22 }; 23 23 24 sub filelist { 25 foreach $file ( sort @filelist) { 26 if( $HTML) { 27 print "$file<BR>\n"; 28 } 29 else { 30 print "$file\n"; 31 }; 32 }; 33 } 34 35 sub listnodes { 36 opendir(DIR, $ndir) || die "can't opendir $ndir: $!"; 37 @tmpdirs = grep { /^[^\.]/ && -d "$ndir/$_" } readdir(DIR); 38 closedir DIR; 39 foreach $dir (sort @tmpdirs) { 40 if( not exists($removefromnodelist{$dir}) ) 41 { 42 push(@nodelist, $dir); 43 } 44 else 45 { 46 if ( $debug ) { print "'$dir' removed from list\n"; } 47 } 48 }; 49 return @nodelist; 50 } 51 52 sub nodelist { 53 foreach $node (listnodes( )) { 54 if( $HTML) { 55 print "$node<BR>\n"; 56 } 57 else { 58 print "$node\n"; 59 }; 60 }; 61 } 24 62 25 63 #REQUEST parsen 26 64 $request=$ENV{'REQUEST_URI'}; 27 if( $request=~/ cgi-bin\/g_list.pl\/(.*)$/) {65 if( $request=~/.*g_list.pl\/(.*)$/) { 28 66 ($node,$file)=split(/\//,$1); 29 67 $title="$node $file"; 68 if ( $debug ) { print "Node: $node\n"; } 69 if ( $debug ) { print "File: $file\n"; } 30 70 } 31 71 else { … … 64 104 } 65 105 else { 66 g_list( ); 67 }; 106 g_list( ); 107 } 108 } 109 elsif( $node eq 'filelist' ) { 110 filelist( ); 111 } 112 elsif( $node eq 'nodelist' ) { 113 nodelist( ); 68 114 } 69 115 else { 70 116 if( $file eq '') { 71 foreach $file ( sort @filelist) { 72 if( $HTML) { 73 print "$file<BR>\n"; 74 } 75 else { 76 print "$file\n"; 77 }; 78 }; 117 filelist( ); 79 118 } 80 119 elsif( $file eq 'config') { … … 115 154 }; 116 155 117 opendir(DIR, $ndir) || die "can't opendir $ndir: $!"; 118 @dirs = grep { /^[^\.]/ && -d "$ndir/$_" } readdir(DIR); 119 closedir DIR; 156 @dirs = listnodes( ); 120 157 foreach $dir (sort @dirs) { 121 158 if( $dir=~/attic/ ) { -
tools/FreeBSD6_x/genesis.conf
r4746 r5230 17 17 $filelist[6]="txtconfig"; 18 18 $filelist[7]="authorized_keys"; 19 20 #Ignore this node diretories 21 %removefromnodelist = ( 22 'retired' => 'YES', 23 'obsolete' => 'YES', 24 ); 25 19 26 20 27 #(inter)net env
Note:
See TracChangeset
for help on using the changeset viewer.