diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-10-04 05:05:52 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-10-04 05:05:52 -0500 |
commit | 62405748ab1470aac11811167c001ce7cbeb040a (patch) | |
tree | 404c1fd7db4a1e3bab5916e9d5afa85be331332f /sboconfig | |
parent | bf6b66358659cf0e49d207ea4286b4153a1e6610 (diff) | |
download | sbotools2-62405748ab1470aac11811167c001ce7cbeb040a.tar.xz |
removed 'date:' line from comments, cleanups for quote consistency, etc
Diffstat (limited to 'sboconfig')
-rwxr-xr-x | sboconfig | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6,7 +6,6 @@ # script to handle sbotools configuration # # author: Jacob Pipkin <j@dawnrazor.net> -# date: Pungenday, the 40th day of Discord in the YOLD 3178 # license: WTFPL <http://sam.zoy.org/wtfpl/COPYING> use 5.16.0; @@ -83,7 +82,7 @@ while (my ($key, $value) = each %valid_confs) { $changes{$value} = $options{$key} if exists $options{$key}; } -my $die = "You have provided an invalid parameter for"; +my $die = 'You have provided an invalid parameter for'; if (exists $changes{NOCLEAN}) { die "$die -c\n" unless $changes{NOCLEAN} =~ /^(TRUE|FALSE)$/; @@ -103,6 +102,9 @@ if (exists $changes{SBO_HOME}) { # safely modify our conf file; write its contents to a temp file, modify the # temp file, write the contents of the temp file back to the conf file +# TODO: if multiple options are provided to this script, this sub should write +# them all at once, instead of only a single one and having to call it once for +# each option specified to the script. sub config_write ($$) { exists $_[1] or script_error 'config_write requires two arguments.'; my ($key, $val) = @_; @@ -125,7 +127,7 @@ sub config_write ($$) { untie @temp; # otherwise, append our new $key=$value pair print {$tempfh} "$key=$val\n" unless $has; - # then over write the conf file with the contents of the temp file + # then overwrite the conf file with the contents of the temp file seek $tempfh, 0, 0; my $contents = do {local $/; <$tempfh>}; close $conffh; |