diff options
-rwxr-xr-x | sboconfig | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -44,7 +44,7 @@ EOF } my %options; -getopts ('hvlc:d:p:s:j:',\%options); +getopts ('hvlc:d:p:s:j:', \%options); show_usage () and exit (0) if exists $options{h}; show_version () and exit (0) if exists $options{v}; @@ -67,7 +67,7 @@ my %valid_confs = ( ); my %changes; -while (my ($key,$value) = each %valid_confs) { +while (my ($key, $value) = each %valid_confs) { $changes{$value} = $options{$key} if exists $options{$key}; } if (exists $changes{JOBS}) { @@ -82,13 +82,13 @@ my $conf_file = $SBO::Lib::conf_file; sub config_write { script_error ('config_write requires two arguments.') unless exists $_[1]; - my ($key,$val) = @_; + my ($key, $val) = @_; if (! -d $conf_dir) { - mkdir($conf_dir) + mkdir ($conf_dir) or print "Unable to create $conf_dir. Exiting.\n" and exit (1); } if (-f $conf_file) { - my ($fh,$filename) = make_temp_file (); + my ($fh, $filename) = make_temp_file (); open my $reader, '<', $conf_file; print {$fh} <$reader>; close ($fh); @@ -108,7 +108,7 @@ sub config_write { print {$writer} "$key=$val\n"; close ($writer); } - move ($filename,$conf_file); + move ($filename, $conf_file); } else { open my $writer, '>', $conf_file; print {$writer} "$key=$val\n"; @@ -116,9 +116,9 @@ sub config_write { } } -while (my ($key,$value) = each %changes) { +while (my ($key, $value) = each %changes) { print "Setting $key to $value...\n"; - config_write ($key,$value); + config_write ($key, $value); } exit 0; |