📄 tunefs.cgi
字号:
#!/usr/local/bin/perl# tunefs.cgi# You can tune a filesystem, but you can't tuna fishrequire './format-lib.pl';&ReadParse();&can_edit_disk($in{'dev'}) || &error("You are not allowed to tune this disk");$whatfailed = "Failed to tune filesystem";$cmd = "tunefs";$cmd .= &opt_check("ufs_a", "number of contiguous blocks", '\d+', "-a");$cmd .= &opt_check("ufs_d", "rotational delay", '\d+', "-d");$cmd .= &opt_check("ufs_e", "maximum number of blocks", '\d+', "-e");$cmd .= &opt_check("ufs_m", "percentage of reserved space", '\d+', "-m");$cmd .= $in{ufs_o} ? " -o $in{ufs_o}" : "";$in{dev} =~ s/dsk/rdsk/g;$cmd .= " $in{dev}";&header("Create Filesystem", "");print "<hr>\n";print "Executing command <tt>$cmd</tt> ...<p>\n";print "<pre>\n";open(TUNEFS, "$cmd 2>&1 </dev/null |");while(<TUNEFS>) { print; }close(TUNEFS);print "</pre>\n";if ($?) { print "... <b>command failed!</b> <p>\n"; }else { print "... command complete. <p>\n"; }print "<hr>\n";&footer("", "disk list");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -