⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newfs.cgi

📁 Unix下基于Web的管理工具
💻 CGI
字号:
#!/usr/local/bin/perl# newfs.cgi# Create a new filesystem require './format-lib.pl';&ReadParse();&can_edit_disk($in{'dev'}) || &error("You are not allowed to format this disk");$whatfailed = "Failed to create filesystem";$cmd = "newfs";$cmd .= &opt_check("ufs_a", "number of spare blocks", '\d+', "-a");$cmd .= &opt_check("ufs_b", "logical block size", '\d+', "-b");$cmd .= &opt_check("ufs_c", "number of cylinders", '\d+', "-c");$cmd .= &opt_check("ufs_d", "rotational delay", '\d+', "-d");$cmd .= &opt_check("ufs_f", "fragment size", '\d+', "-f");$cmd .= &opt_check("ufs_i", "inode size", '\d+', "-i");$cmd .= &opt_check("ufs_m", "percentage of reserved space", '\d+', "-m");$cmd .= &opt_check("ufs_n", "number of rotational positions", '\d+', "-n");$cmd .= $in{ufs_o} ? " -o $in{ufs_o}" : "";$cmd .= &opt_check("ufs_r", "disk speed", '\d+', "-r");$cmd .= &opt_check("ufs_s", "filesystem size", '\d+', "-s");$cmd .= &opt_check("ufs_t", "number of tracks", '\d+', "-t");$cmd .= &opt_check("ufs_cb", "number of contiguous blocks", '\d+', "-C");$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(MKFS, "$cmd 2>&1 </dev/null |");while(<MKFS>) { print; }close(MKFS);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 + -