Changeset 1225 in MondoRescue
- Timestamp:
- Mar 6, 2007, 1:08:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo-web/mondo-web.pl
r1223 r1225 18 18 use Data::Dumper; 19 19 use AppConfig; 20 use AppConfig::File;21 20 22 21 my $cgi = new CGI; 22 my $default = ""; 23 my @default; 23 24 24 25 # Handling Configuration files 25 #my $file = "/etc/mondo/mondo.conf.dist"; 26 #my $config = AppConfig->new(); 27 #my $cfgfile = $config->file($file); 28 #$config->parse($file); # read config file 29 #print Dumper($cfgfile); 26 my $file1 = "/etc/mondo/mondo.conf.dist"; 27 my $file2 = "/etc/mondo/mondo.conf"; 28 29 my $config = AppConfig->new({ 30 # Auto Create variables mentioned in Conf file 31 CREATE => 1, 32 DEBUG => 0, 33 GLOBAL => { 34 # Each conf item has one single parameter 35 ARGCOUNT => AppConfig::ARGCOUNT_ONE 36 } 37 }); 38 $config->file($file1, $file2); 30 39 31 40 my $command=""; … … 55 64 my @options = sort keys %options; 56 65 my %speed = ( 66 1 => '1x', 57 67 2 => '2x', 58 68 4 => '4x', … … 111 121 print "Destination path or device:\n"; 112 122 print $cgi->textfield(-name=>'dest', 113 -default=> '',123 -default=>$config->get("mondo_images_dir"), 114 124 -size=>15, 115 125 -maxlenght=>150); … … 117 127 print "Size of media (MB):\n"; 118 128 print $cgi->textfield(-name=>'size', 119 -default=> '4380',129 -default=>$config->get("mondo_media_size"), 120 130 -size=>6, 121 131 -maxlenght=>6); … … 125 135 print $cgi->h2('Compression Info'); 126 136 print "<TABLE><TR><TD WIDTH=330>\n"; 137 $default = 'GZIP' if ($config->get("mondo_compression_tool") =~ /gzip/); 138 $default = 'BZIP2' if ($config->get("mondo_compression_tool") =~ /bzip2/); 139 $default = 'LZO' if ($config->get("mondo_compression_tool") =~ /lzo/); 127 140 print "Compression tool: ",$cgi->popup_menu(-name=>'comp', 128 141 -values=>\@comp, 129 -default=> 'GZIP',142 -default=>$default, 130 143 -labels=>\%comp); 131 144 print "</TD><TD WIDTH=300>\n"; 132 145 print "Compression ratio: ",$cgi->popup_menu(-name=>'compratio', 133 146 -values=>\@ratio, 134 -default=> 6,147 -default=>$config->get("mondo_compression_level"), 135 148 -labels=>\%ratio); 136 149 print "</TD></TR></TABLE>\n"; … … 139 152 print $cgi->h2('Optional Info'); 140 153 print "<TABLE><TR><TD WIDTH=360>\n"; 154 155 @default = (@default,'AUTO') if ($config->get("mondo_automatic_restore") =~ /yes/); 156 @default = (@default,'NOFLOPPY') if ($config->get("mondo_write_boot_floppy") =~ /no/); 157 @default = (@default,'DIFF') if ($config->get("mondo_differential") =~ /yes/); 158 #'NFSEXCL' => 'Exclude Network File Systems', 159 @default = (@default, 'NFSEXCL'); 160 #'NOBOOTABLE' => 'Create Non-Bootable media', 161 #'MANEJECT' => 'Manual media ejection', 162 #'VERIF' => 'Media verification (Slower)', 163 #'XATTR' => 'Extended Attributes and ACL Management (Slower)' 141 164 print $cgi->checkbox_group(-name=>'options', 142 165 -values=>\@options, 143 -defaults=> ['NFSEXCL', 'NOFLOPPY'],166 -defaults=>\@default, 144 167 -linebreak=>'true', 145 168 -labels=>\%options); … … 147 170 print "Temporary Directory:\n"; 148 171 print $cgi->textfield(-name=>'temp', 149 -default=> '/var/cache/mondo/tmp',172 -default=>$config->get("mondo_tmp_dir"), 150 173 -size=>25, 151 174 -maxlenght=>150); … … 153 176 print "Scratch Directory:\n"; 154 177 print $cgi->textfield(-name=>'scratch', 155 -default=> '/var/cache/mondo/scratch',178 -default=>$config->get("mondo_scratch_dir"), 156 179 -size=>25, 157 180 -maxlenght=>150); … … 159 182 print "ISO Image Name Prefix:\n"; 160 183 print $cgi->textfield(-name=>'prefix', 161 -default=> 'mondorescue',184 -default=>$config->get("mondo_prefix"), 162 185 -size=>15, 163 186 -maxlenght=>150); … … 165 188 print "Tape block size:\n"; 166 189 print $cgi->textfield(-name=>'block', 167 -default=> '32768',190 -default=>$config->get("mondo_external_tape_blocksize"), 168 191 -size=>10, 169 192 -maxlenght=>10); … … 171 194 print "Media Speed (if pertinent): ",$cgi->popup_menu(-name=>'speed', 172 195 -values=>\@speed, 173 -default=>$ speed[-1],196 -default=>$config->get("mondo_iso_burning_speed"), 174 197 -labels=>\%speed); 175 198 print "<BR>"; 176 199 print "Kernel:\n"; 177 200 print $cgi->textfield(-name=>'kernel', 178 -default=> 'NATIVE',201 -default=>$config->get("mondo_kernel"), 179 202 -size=>30, 180 203 -maxlenght=>150); … … 196 219 print "Bootloader:<BR>\n",$cgi->radio_group(-name=>'boot', 197 220 -values=>\@boot, 198 -default=> 'NATIVE',221 -default=>$config->get("mondo_boot_loader"), 199 222 -linebreak=>'true', 200 223 -labels=>\%boot); … … 203 226 print $cgi->popup_menu(-name=>'debug', 204 227 -values=>\@ratio, 205 -default=> 2,228 -default=>$config->get("mondo_log_level"), 206 229 -labels=>\%ratio); 207 230 print "</TD><TD>\n"; 208 231 print "Excluded directories:\n"; 209 232 print $cgi->textfield(-name=>'exclude', 210 -default=> '',233 -default=>$config->get("mondo_exclude_files"), 211 234 -size=>30, 212 235 -maxlenght=>150); … … 214 237 print "Included directories:\n"; 215 238 print $cgi->textfield(-name=>'include', 216 -default=> '',239 -default=>$config->get("mondo_include_files"), 217 240 -size=>30, 218 241 -maxlenght=>150);
Note:
See TracChangeset
for help on using the changeset viewer.