📄 unixware-lib.pl
字号:
print "</td> </tr>\n"; } } else { print "<tr> <td><b>NFS Hostname</b></td>\n"; print "<td><input name=nfs_host size=20 value=\"$nfshost\">\n"; &nfs_server_chooser_button("nfs_host"); print "</td>\n"; print "<td><b>NFS Directory</b></td>\n"; print "<td><input name=nfs_dir size=20 value=\"$nfspath\">\n"; &nfs_export_chooser_button("nfs_host", "nfs_dir"); print "</td> </tr>\n"; } }elsif ($_[0] eq "tmpfs") { # Location is irrelevant for tmpfs filesystems }elsif ($_[0] eq "ufs") { # Mounted from a normal disk, raid (MD) device or from # somewhere else print "<tr> <td valign=top><b>UFS Disk</b></td>\n"; print "<td colspan=3>\n"; if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/) { $ufs_dev = 0; $scsi_c = $1; $scsi_t = $2; $scsi_d = $3; $scsi_s = $4; } elsif ($_[1] eq "") { $ufs_dev = 0; $scsi_c = $scsi_t = $scsi_s = $scsi_d = 0; } elsif ($_[1] =~ /^\/dev\/md\/dsk\/d([0-9]+)$/) { $ufs_dev = 1; $scsi_md = $1; } else { $ufs_dev = 2; $scsi_path = $_[1]; } printf "<input type=radio name=ufs_dev value=0 %s> SCSI Disk:\n", $ufs_dev == 0 ? "checked" : ""; print "Controller <input name=ufs_c size=3 value=\"$scsi_c\">\n"; print "Target <input name=ufs_t size=3 value=\"$scsi_t\">\n"; print "Unit <input name=ufs_d size=3 value=\"$scsi_d\">\n"; print "Partition <input name=ufs_s size=3 value=\"$scsi_s\"><br>\n"; printf "<input type=radio name=ufs_dev value=1 %s> RAID Device:\n", $ufs_dev == 1 ? "checked" : ""; print "Unit <input name=ufs_md size=3 value=\"$scsi_md\"><br>\n"; printf "<input type=radio name=ufs_dev value=2 %s> Other Device:\n", $ufs_dev == 2 ? "checked" : ""; print "<input name=ufs_path size=20 value=\"$scsi_path\"><br>\n"; print "</td> </tr>\n"; }elsif ($_[0] eq "vxfs") { # Mounted from a normal disk, LVM device or from # somewhere else print "<tr> <td valign=top><b>VXFS Device</b></td>\n"; print "<td colspan=3>\n"; if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/) { $jfs_dev = 0; $scsi_c = $1; $scsi_t = $2; $scsi_d = $3; $scsi_s = $4; } elsif ($_[1] eq "") { $jfs_dev = 0; $scsi_c = $scsi_t = $scsi_s = $scsi_d = 0; } elsif ($_[1] =~ /^\/dev\/vg([0-9]+)\/(\S+)/) { $jfs_dev = 1; $scsi_vg = $1; $scsi_lv = $2; } else { $jfs_dev = 2; $scsi_path = $_[1]; } $scsi_path = $_[1]; printf "<input type=radio name=jfs_dev value=0 %s> SCSI Disk:\n", $jfs_dev == 0 ? "checked" : ""; print "Controller <input name=jfs_c size=3 value=\"$scsi_c\">\n"; print "Target <input name=jfs_t size=3 value=\"$scsi_t\">\n"; print "Unit <input name=jfs_d size=3 value=\"$scsi_d\">\n"; print "Partition <input name=jfs_s size=3 value=\"$scsi_s\"><br>\n"; printf "<input type=radio name=jfs_dev value=1 %s> LVM Device:\n", $jfs_dev == 1 ? "checked" : ""; print "Volume Group <input name=jfs_vg size=2 value=\"$scsi_vg\">\n"; print "Logical Volume <input name=jfs_lv size=20 value=\"$scsi_lv\"><br>\n"; printf "<input type=radio name=jfs_dev value=2 %s> Other Device:\n", $jfs_dev == 2 ? "checked" : ""; print "<input name=jfs_path size=20 value=\"$scsi_path\">"; print &file_chooser_button("jfs_path", 0); print "<br>\n"; print "</td> </tr>\n"; }elsif ($_[0] eq "swap") { # Swapping to a disk partition or a file print "<tr> <td valign=top><b>Swap File</b></td>\n"; print "<td colspan=3>\n"; if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/) { $swap_dev = 0; $scsi_c = $1; $scsi_t = $2; $scsi_d = $3; $scsi_s = $4; } elsif ($_[1] eq "") { $swap_dev = 1; $scsi_path = ""; } else { $swap_dev = 1; $scsi_path = $_[1]; } printf "<input type=radio name=swap_dev value=0 %s> SCSI Disk:\n", $swap_dev == 0 ? "checked" : ""; print "Controller <input name=swap_c size=3 value=\"$scsi_c\">\n"; print "Target <input name=swap_t size=3 value=\"$scsi_t\">\n"; print "Unit <input name=swap_d size=3 value=\"$scsi_d\">\n"; print "Partition <input name=swap_s size=3 value=\"$scsi_s\"><br>\n"; printf "<input type=radio name=swap_dev value=1 %s> File:\n", $swap_dev == 1 ? "checked" : ""; print "<input name=swap_path size=20 value=\"$scsi_path\"><br>\n"; print "</td> </tr>\n"; }elsif ($_[0] eq "hsfs") { # Mounting a SCSI cdrom print "<tr> <td valign=top><b>CDROM Disk</b></td>\n"; print "<td colspan=3>\n"; if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/) { $hsfs_dev = 0; $scsi_c = $1; $scsi_t = $2; $scsi_d = $3; $scsi_s = $4; } elsif ($_[1] eq "") { $hsfs_dev = 0; $scsi_c = 0; $scsi_t = 6; $scsi_d = 0; $scsi_s = 0; } else { $hsfs_dev = 1; $scsi_path = $_[1]; } printf "<input type=radio name=hsfs_dev value=0 %s> SCSI Device:\n", $hsfs_dev == 0 ? "checked" : ""; print "Controller <input name=hsfs_c size=3 value=\"$scsi_c\">\n"; print "Target <input name=hsfs_t size=3 value=\"$scsi_t\">\n"; print "Unit <input name=hsfs_d size=3 value=\"$scsi_d\">\n"; print "Partition <input name=hsfs_s size=3 value=\"$scsi_s\"><br>\n"; printf "<input type=radio name=hsfs_dev value=1 %s> Other Device:\n", $hsfs_dev == 1 ? "checked" : ""; print "<input name=hsfs_path size=20 value=\"$scsi_path\"><br>\n"; print "</td> </tr>\n"; }elsif ($_[0] eq "pcfs") { # Mounting a SCSI msdos filesystem print "<tr> <td valign=top><b>MS-DOS Disk</b></td>\n"; print "<td colspan=3>\n"; if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/) { $pcfs_dev = 0; $scsi_c = $1; $scsi_t = $2; $scsi_d = $3; $scsi_s = $4; } elsif ($_[1] eq "") { $pcfs_dev = 1; $scsi_path = ""; } else { $pcfs_dev = 1; $scsi_path = $_[1]; } printf "<input type=radio name=pcfs_dev value=0 %s> SCSI Device:\n", $pcfs_dev == 0 ? "checked" : ""; print "Controller <input name=pcfs_c size=3 value=\"$scsi_c\">\n"; print "Target <input name=pcfs_t size=3 value=\"$scsi_t\">\n"; print "Unit <input name=pcfs_d size=3 value=\"$scsi_d\">\n"; print "Partition <input name=pcfs_s size=3 value=\"$scsi_s\"><br>\n"; printf "<input type=radio name=pcfs_dev value=1 %s> Other Device:\n", $pcfs_dev == 1 ? "checked" : ""; print "<input name=pcfs_path size=20 value=\"$scsi_path\"><br>\n"; print "</td> </tr>\n"; }elsif ($_[0] eq "lofs") { # Mounting some directory to another location print "<tr> <td><b>Original Directory</b></td>\n"; print "<td><input name=lofs_src size=30 value=\"$_[1]\">\n"; print &file_chooser_button("lofs_src", 1); print "</td> </tr>\n"; }elsif ($_[0] eq "cachefs") { # Mounting a cached filesystem of some type.. need a location for # the source of the mount print "<tr> <td><b>Cache Source</b></td>\n"; print "<td><input name=cfs_src size=20 value=\"$_[1]\"></td> </tr>\n"; }elsif ($_[0] eq "autofs") { # An automounter entry.. can be -hosts, -xfn or from some mapping print "<tr> <td valign=top><b>Automounter map</b></td>\n"; printf "<td><input type=radio name=autofs_type value=0 %s>\n", $_[1] eq "-hosts" || $_[1] eq "-xfn" ? "" : "checked"; printf "Use map <input name=autofs_map size=20 value=\"%s\"><br>\n", $_[1] eq "-hosts" || $_[1] eq "-xfn" ? "" : $_[1]; printf "<input type=radio name=autofs_type value=1 %s>\n", $_[1] eq "-hosts" ? "checked" : ""; print "All NFS exports map<br>\n"; printf "<input type=radio name=autofs_type value=2 %s>\n", $_[1] eq "-xfn" ? "checked" : ""; print "Federated Naming Service map</td> </tr>\n"; }elsif ($_[0] eq "rumba") { # Windows filesystem $_[1] =~ /^\\\\(.*)\\(.*)$/; print "<tr> <td><b>Server Name</b></td>\n"; print "<td><input name=rumba_server value=\"$1\" size=20>\n"; &smb_server_chooser_button("rumba_server"); print "</td>\n"; print "<td><b>Share Name</b></td>\n"; print "<td><input name=rumba_share value=\"$2\" size=20>\n"; &smb_share_chooser_button("rumba_server", "rumba_share"); print "</td> </tr>\n"; }}# generate_options(type, newmount)# Output HTML for editing mount options for a partilcar filesystem # under this OSsub generate_options{if ($_[0] eq "nfs") { # UnixWare NFS has many options, not all of which are editable here print "<tr> <td><b>Read-Only?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_ro value=1 %s> Yes\n", defined($options{"ro"}) ? "checked" : ""; printf "<input type=radio name=nfs_ro value=0 %s> No</td>\n", defined($options{"ro"}) ? "" : "checked"; print "<td><b>Disallow setuid programs?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_nosuid value=1 %s> Yes\n", defined($options{"nosuid"}) ? "checked" : ""; printf "<input type=radio name=nfs_nosuid value=0 %s> No</td> </tr>\n", defined($options{"nosuid"}) ? "" : "checked"; print "<tr> <td><b>Files inherit parent GID?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_grpid value=0 %s> Yes\n", defined($options{"grpid"}) ? "" : "checked"; printf "<input type=radio name=nfs_grpid value=1 %s> No</td>\n", defined($options{"grpid"}) ? "checked" : ""; print "<td><b>Return error on timeouts?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_soft value=1 %s> Yes\n", defined($options{"soft"}) ? "checked" : ""; printf "<input type=radio name=nfs_soft value=0 %s> No</td> </tr>\n", defined($options{"soft"}) ? "" : "checked"; print "<tr> <td><b>Retry mounts in background?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_bg value=1 %s> Yes\n", defined($options{"bg"}) ? "checked" : ""; printf "<input type=radio name=nfs_bg value=0 %s> No</td>\n", defined($options{"bg"}) ? "" : "checked"; print "<td><b>Display quotas?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_quota value=1 %s> Yes\n", defined($options{"quota"}) ? "checked" : ""; printf "<input type=radio name=nfs_quota value=0 %s> No</td> </tr>\n", defined($options{"quota"}) ? "" : "checked"; print "<tr> <td><b>Allow user interrupt?</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_nointr value=0 %s> Yes\n", defined($options{"nointr"}) ? "" : "checked"; printf "<input type=radio name=nfs_nointr value=1 %s> No</td>\n", defined($options{"nointr"}) ? "checked" : ""; print "<td><b>NFS version</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_vers_def value=1 %s> Highest\n", defined($options{"vers"}) ? "" : "checked"; printf "<input type=radio name=nfs_vers_def value=0 %s>\n", defined($options{"vers"}) ? "checked" : ""; print "<input size=1 name=nfs_vers value=$options{vers}></td> </tr>\n"; print "<tr> <td><b>Protocol</b></td>\n"; print "<td nowrap><select name=proto>\n"; printf "<option value=\"\" %s> Default\n", defined($options{"proto"}) ? "" : "selected"; foreach (split(/\n/, `cat /etc/netconfig`)) { if (!/^([A-z0-9\_\-]+)\s/) { next; } printf "<option value=\"$1\" %s> $1\n", $options{"proto"} eq $1 ? "selected" : ""; } print "</select></td>\n"; print "<td><b>NFS Port</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_port_def value=1 %s> Default\n", defined($options{"port"}) ? "" : "checked"; printf "<input type=radio name=nfs_port_def value=0 %s>\n", defined($options{"port"}) ? "checked" : ""; print "<input size=5 name=nfs_port value=$options{port}></td> </tr>\n"; print "<tr> <td><b>Timeout</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_timeo_def value=1 %s> Default\n", defined($options{"timeo"}) ? "" : "checked"; printf "<input type=radio name=nfs_timeo_def value=0 %s>\n", defined($options{"timeo"}) ? "checked" : ""; printf "<input size=5 name=nfs_timeo value=$options{timeo}></td>\n"; print "<td><b>Number of Retransmissions</b></td>\n"; printf "<td nowrap><input type=radio name=nfs_retrans_def value=1 %s> Default\n", defined($options{"retrans"}) ? "" : "checked"; printf "<input type=radio name=nfs_retrans_def value=0 %s>\n", defined($options{"retrans"}) ? "checked" : ""; print "<input size=5 name=nfs_retrans value=$options{retrans}></td> </tr>\n"; print "<tr> <td><b>Authentication</b></td>\n"; $nfs_auth = $options{'sec'} ? $options{'sec'} : defined($options{"secure"}) ? "dh" : defined($options{"kerberos"}) ? "krb" : ""; print "<td><select name=nfs_auth>\n"; printf "<option value=\"\" %s> None\n", $nfs_auth eq "" ? "selected" : ""; printf "<option value=dh %s> DES\n", $nfs_auth eq "dh" ? "selected" : ""; printf "<option value=krb %s> Kerberos\n", $nfs_auth eq "krb" ? "selected" : ""; print "</select></td>\n"; if ($gconfig{'os_version'} >= 7) { print "<td><b>WebNFS mount?</b></td> <td>\n"; printf "<input type=radio name=nfs_public value=1 %s> Yes\n", defined($options{'public'}) ? "checked" : ""; printf "<input type=radio name=nfs_public value=0 %s> No\n", defined($options{'public'}) ? "" : "checked"; print "</td>\n"; } print "</tr>\n"; }if ($_[0] eq "ufs") { # UnixWare UFS also has many options, not all of which are here print "<tr> <td><b>Read-Only?</b></td>\n"; printf "<td nowrap><input type=radio name=ufs_ro value=1 %s> Yes\n", defined($options{"ro"}) ? "checked" : ""; printf "<input type=radio name=ufs_ro value=0 %s> No</td>\n", defined($options{"ro"}) ? "" : "checked"; print "<td><b>Disallow setuid programs?</b></td>\n"; printf "<td nowrap><input type=radio name=ufs_nosuid value=1 %s> Yes\n", defined($options{"nosuid"}) ? "checked" : ""; printf "<input type=radio name=ufs_nosuid value=0 %s> No</td> </tr>\n", defined($options{"nosuid"}) ? "" : "checked"; print "<tr> <td><b>Allow user interrupt?</b></td>\n"; printf "<td nowrap><input type=radio name=ufs_nointr value=0 %s> Yes\n", defined($options{"nointr"}) ? "" : "checked"; printf "<input type=radio name=ufs_nointr value=1 %s> No</td>\n", defined($options{"nointr"}) ? "checked" : ""; print "<td><b>Enable quotas at boot time?</b></td>\n"; printf "<td nowrap><input type=radio name=ufs_quota value=1 %s> Yes\n", defined($options{"quota"}) || defined($options{"rq"}) ? "checked" : ""; printf "<input type=radio name=ufs_quota value=0 %s> No</td> </tr>\n", defined($options{"quota"}) || defined($options{"rq"}) ? "" : "checked"; print "<tr> <td><b>Action on error</b></td>\n"; print "<td><select name=ufs_onerror>\n"; foreach ('panic', 'lock', 'umount', 'repair') { printf "<option value=\"$_\" %s> $_\n", $options{onerror} eq $_ || !defined($options{onerror}) && $_ eq "panic" ? "selected" : ""; } print "</select></td>\n"; print "<td><b>Repair Delay</b></td>\n"; $options{toosoon} =~ /([0-9]+)([A-z])/; print "<td nowrap><input size=5 name=ufs_toosoon_time value=$1>\n"; print "<select name=ufs_toosoon_units>\n"; printf "<option value=s %s> Seconds\n", $2 eq "s" ? "selected" : ""; printf "<option value=m %s> Minutes\n", $2 eq "m" ? "selected" : ""; printf "<option value=h %s> Hours\n", $2 eq "h" ? "selected" : ""; printf "<option value=d %s> Days\n", $2 eq "d" ? "selected" : ""; printf "<option value=w %s> Months\n", $2 eq "w" ? "selected" : ""; printf "<option value=y %s> Years\n", $2 eq "y" ? "selected" : ""; print "</select></td> </tr>\n"; if ($gconfig{'os_version'} >= 7) { print "<tr> <td><b>Update access times?</b></td> <td>\n"; printf "<input type=radio name=ufs_noatime value=0 %s> Yes\n", defined($options{'noatime'}) ? "" : "checked"; printf "<input type=radio name=ufs_noatime value=1 %s> No\n", defined($options{'noatime'}) ? "checked" : ""; print "</td>\n"; print "<td><b>Force direct IO?</b></td> <td>\n"; printf "<input type=radio name=ufs_force value=1 %s> Yes\n", defined($options{'forcedirectio'}) ? "checked" : ""; printf "<input type=radio name=ufs_force value=0 %s> No\n", defined($options{'forcedirectio'}) ? "" : "checked"; print "</td> </tr>\n"; print "<tr> <td><b>Allow large files?</td> <td>\n"; printf "<input type=radio name=ufs_nolarge value=0 %s> Yes\n", defined($options{'nolargefiles'}) ? "" : "checked"; printf "<input type=radio name=ufs_nolarge value=1 %s> No\n", defined($options{'nolargefiles'}) ? "checked" : ""; print "</td>\n"; print "<td><b>Enabled logging?</td> <td>\n"; printf "<input type=radio name=ufs_logging value=1 %s> Yes\n", defined($options{'logging'}) ? "checked" : ""; printf "<input type=radio name=ufs_logging value=0 %s> No\n", defined($options{'logging'}) ? "" : "checked"; print "</td> </tr>\n"; } }if ($_[0] eq "hsfs") { # UnixWare hsfs is used for CDROMs print "<tr> <td><b>Ignore Unix attributes?</b></td>\n"; printf "<td nowrap><input type=radio name=hsfs_nrr value=1 %s> Yes\n", defined($options{"nrr"}) ? "checked" : ""; printf "<input type=radio name=hsfs_nrr value=0 %s> No</td>\n", defined($options{"nrr"}) ? "" : "checked"; print "<td><b>Ignore trailing dot?</b></td>\n"; printf "<td nowrap><input type=radio name=hsfs_notraildot value=1 %s> Yes\n", defined($options{"notraildot"}) ? "checked" : ""; printf "<input type=radio name=hsfs_notraildot value=0 %s> No</td> </tr>\n", defined($options{"notraildot"}) ? "" : "checked"; print "<tr> <td><b>Use lower case?</b></td>\n"; printf "<td nowrap><input type=radio name=hsfs_nomaplcase value=0 %s> Yes\n", defined($options{"nomaplcase"}) ? "" : "checked"; printf "<input type=radio name=hsfs_nomaplcase value=1 %s> No</td>\n", defined($options{"nomaplcase"}) ? "checked" : "";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -