📄 index.cgi
字号:
#!/usr/local/bin/perl# index.cgi# Display a list of known services, built from those handled by inetd and# from the services filerequire './inetd-lib.pl';&header("Internet Services", "", undef, 1, 1);print "<hr>\n";# break down into rpc and internet services$j = 0;foreach $i (&list_inets()) { if ($i->[2]) { # rpc service $i->[3] =~ /^(\S+)\//; if ($i->[1]) { $rpc_active{$1} = $j; } else { $rpc_disabled{$1} = $j; } } else { # internet service if ($i->[1]) { $int_active{$i->[3],$i->[5]} = $j; } else { $int_disabled{$i->[3],$i->[5]} = $j; } } $j++; }print "<table border width=100%>\n";print "<tr $tb> <td><b>Internet Services</b></td> </tr>\n";print "<tr $cb> <td><table width=100%>\n";$i = 0; $spos = -1;foreach $s (&list_services()) { $spos++; $ia = $int_active{$s->[1],$s->[3]}; $id = $int_disabled{$s->[1],$s->[3]}; if ($ia =~ /\d/) { $op = "<b>"; $cl = "</b>"; $ip = $ia; } elsif ($id =~ /\d/) { $op = "<i>"; $cl = "</i>"; $ip = $id; } elsif (!$config{'show_empty'}) { next; } else { $op = $cl = $ip = ""; } if ($i%4 == 0) { print "<tr>\n"; } print "<td>$op"; print "<a href=\"edit_serv.cgi?spos=$spos&ipos=$ip\">$s->[1]</a>", "($s->[3])"; print "$cl</td>\n"; if ($i++%4 == 3) { print "</tr>\n"; } }print "</table></td></tr></table>\n";print "<a href=\"edit_serv.cgi?new=1\">Create a new internet service</a>.<p>\n";print "<hr>\n";print "<table border width=100%>\n";print "<tr $tb> <td><b>RPC Programs</b></td> </tr>\n";print "<tr $cb> <td><table width=100%>\n";$i = 0;foreach $r (&list_rpcs()) { if ($i%4 == 0) { print "<tr $cb>\n"; } $ra = $rpc_active{$r->[1]}; $rd = $rpc_disabled{$r->[1]}; if ($ra =~ /\d/) { $op = "<b>"; $cl = "</b>"; $rp = $ra; } elsif ($rd =~ /\d/) { $op = "<i>"; $cl = "</i>"; $rp = $rd; } else { $op = $cl = $rp = ""; } print "<td>$op"; print "<a href=\"edit_rpc.cgi?rpos=$i&ipos=$rp\">$r->[1]</a>"; print "$cl</td>\n"; if ($i++%4 == 3) { print "</tr>\n"; } }print "</table></td></tr></table>\n";print "<a href=\"edit_rpc.cgi?new=1\">Create a new RPC program</a>. <p>\n";print "<hr>\n";print "<form action=restart_inetd.cgi>\n";print "<table width=100%> <tr>\n";print "<td><input type=submit value=\"Apply Changes\"></td>\n";print "<td valign=top> Click this button to apply the current configuration\n";print "by sending a SIGHUP signal to the running <tt>inetd</tt> process</td>\n";print "</tr> </table> </form>\n";print "<hr>\n";&footer("/", "index");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -