Changeset 4087 in genesis
- Timestamp:
- Mar 17, 2005, 12:28:41 PM (20 years ago)
- Location:
- tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/g_list.pl
r4086 r4087 22 22 23 23 #path variablen 24 my $home="/home/ wleiden/genesis";24 my $home="/home/genesis"; 25 25 my $ndir="$home/nodes"; 26 26 my $toolfile="$home/tools/wleiden.pl"; … … 44 44 #REQUEST parsen 45 45 $request=$ENV{'REQUEST_URI'}; 46 if ($request=~/cgi-bin\/g_list.pl\/(.*)$/) {46 if( $request=~/cgi-bin\/g_list.pl\/(.*)$/) { 47 47 ($node,$file)=split(/\//,$1); 48 48 $title="$node $file"; … … 56 56 #en zorgen dan er de nodige tags geprint worden 57 57 $browser=$ENV{'HTTP_USER_AGENT'}; 58 if ($browser=~/curl|wget|fetch/i) {58 if( $browser=~/curl|wget|fetch/i) { 59 59 $HTML=0; 60 60 printline("Content-type: text/html\n\n"); … … 70 70 71 71 #als geen node gespecificeerd dan kijken of svn geupdate is gevraagd 72 if ($node eq '') {73 if ($ENV{"QUERY_STRING"}=~/update/i) {72 if( $node eq '') { 73 if( $ENV{"QUERY_STRING"}=~/update/i) { 74 74 select(STDERR); $| = 1; # make unbuffered 75 75 select(STDOUT); $| = 1; # make unbuffered … … 88 88 } 89 89 else { 90 if ($file eq '') {90 if( $file eq '') { 91 91 foreach $file ( sort @filelist) { 92 if ($HTML) {92 if( $HTML) { 93 93 print "$file<BR>\n"; 94 94 } … … 98 98 }; 99 99 } 100 elsif ($file eq 'config') {100 elsif( $file eq 'config') { 101 101 g_print($hostname); 102 102 } … … 111 111 112 112 #plaats de sluit HTML tags 113 if ($HTML) {113 if( $HTML) { 114 114 print <<EOF; 115 115 </BODY> … … 121 121 #Het opbouwen van het begin scherm 122 122 sub g_list { 123 if ($HTML) {123 if( $HTML) { 124 124 my $svn_version=svn_version("$ndir"); 125 if ($svn_version=~/Last Changed Rev: (\d+)/) {125 if( $svn_version=~/Last Changed Rev: (\d+)/) { 126 126 $revision=$1; 127 127 }; … … 139 139 closedir DIR; 140 140 foreach $dir (sort @dirs) { 141 if ($dir=~/attic/) {141 if( $dir=~/attic/ ) { 142 142 next; 143 143 }; 144 144 my $node = $dir; 145 if (! $HTML) {145 if( ! $HTML ) { 146 146 print "$node\n"; 147 147 } … … 151 151 printline("<TD><A HREF=g_list.pl/$node/$file>$file</A></TD>\n"); 152 152 }; 153 printline("</TABLE><P>"); 154 }; 153 }; 154 }; 155 if( $HTML ) { 156 printline("</TABLE><P>"); 155 157 }; 156 158 }; … … 163 165 local($svn_version); 164 166 $svn_version=`$svn info $file`; 165 if ($char ne '') {167 if( $char ne '' ) { 166 168 $svn_version=~s/^([^$char].*)/$char $1/mgi; 167 169 }; … … 181 183 182 184 my $TP=''; 183 if ($tproxy !~ m/no/i) {185 if( $tproxy !~ m/no/i ) { 184 186 $TP .= "\n"; 185 187 $TP .= "Tproxy on cidr range $tproxy"; … … 210 212 printline("</PRE></TD></TR>"); 211 213 212 foreach $if (sort keys %config) {213 if ($if=~/^(.*):\d+/) {214 foreach $if( sort keys %config) { 215 if( $if=~/^(.*):\d+/ ) { 214 216 $subs{$1}++; 215 217 }; 216 218 }; 217 219 218 foreach $if (sort keys %config) {219 if ($if=~/^([^:]+)/) {220 foreach $if( sort keys %config) { 221 if( $if=~/^([^:]+)/ ) { 220 222 $mymain=$1; 221 223 } … … 224 226 }; 225 227 226 if ($if!~/:\d+/) {228 if( $if!~/:\d+/ ) { 227 229 $main=1;$cc='66' 228 230 } … … 232 234 }; 233 235 234 if (! ($ip=$IP{$if})) {236 if(! ($ip=$IP{$if}) ) { 235 237 $ip='dhcp?'; 236 238 }; 237 if ($TYPE{$if}=~/wireless/) {239 if( $TYPE{$if}=~/wireless/ ) { 238 240 $color="#${cc}FFFF"; 239 241 }; 240 if ($TYPE{$if}=~/ethernet/) {242 if( $TYPE{$if}=~/ethernet/) { 241 243 $color="#FFFF${cc}"; 242 244 }; … … 248 250 $cfg=~s/(.*PASS.*=).*/${1}***********/; 249 251 250 if ($main) {252 if( $main) { 251 253 printf "<TR bgcolor=$color><TD ROWSPAN=%d VALIGN=TOP><B>$if</TD>\n",(1+$subs{$if})*3,$subs{$if}; 252 254 $c=4; … … 277 279 $svn_versionc=svn_version($config,$char); 278 280 279 if ($svn_versiont=~/Last Changed Rev: (\d+)/) {281 if( $svn_versiont=~/Last Changed Rev: (\d+)/ ) { 280 282 $tool_rev=$1; 281 283 }; 282 if ($svn_versionc=~/Last Changed Rev: (\d+)/) {284 if( $svn_versionc=~/Last Changed Rev: (\d+)/ ) { 283 285 $config_rev=$1; 284 286 }; 285 287 286 if ($tool_rev >= $config_rev) {288 if( $tool_rev >= $config_rev) { 287 289 $svn_version=$svn_versiont . $svn_versionc; 288 290 } … … 291 293 }; 292 294 293 if ($HTML) {295 if( $HTML) { 294 296 printline("<H1>Genesis $file voor: $hostname</H1><P>"); 295 297 }; … … 299 301 300 302 301 if ($HTML) {303 if( $HTML ) { 302 304 $pr=~s/</</gi; 303 305 printline("<PRE>$pr</PRE>"); -
tools/wleiden.pl
r4084 r4087 8 8 my $author="feb 2003 jasper\@WirelessLeiden.NL \| maart 2005 rick\@WirelessLeiden.NL"; 9 9 my $wicontrol='/usr/sbin/wicontrol'; 10 my $IP_pmPath='/home/ rick/svn/genesis/tools/IP.pm';11 my $dnsheader_confPath='/home/ rick/svn/genesis/dns/dnsheader.conf';10 my $IP_pmPath='/home/genesis/tools/IP.pm'; 11 my $dnsheader_confPath='/home/genesis/dns/dnsheader.conf'; 12 12 13 13
Note:
See TracChangeset
for help on using the changeset viewer.