aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-27 11:19:32 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-27 11:19:32 +0200
commiteccaf953d4646c90664d9e5a0661c041bec81f97 (patch)
tree44331f25059f280d55e1a3fde36d736c8fe819fd
parent2e26c48aec83e2961bcc29cdd87de4b35ec479e2 (diff)
downloadsbotools2-eccaf953d4646c90664d9e5a0661c041bec81f97.tar.xz
sboconfig: make sure to create /etc/sbotools/ if it doesn't exist
-rwxr-xr-xsboconfig4
1 files changed, 4 insertions, 0 deletions
diff --git a/sboconfig b/sboconfig
index 0dbebb0..ca6d1fa 100755
--- a/sboconfig
+++ b/sboconfig
@@ -129,6 +129,10 @@ if (exists $changes{SLACKWARE_VERSION}) {
sub config_write {
script_error('config_write requires at least two arguments.') unless @_ >= 2;
+ if (! -d $conf_dir) {
+ mkdir $conf_dir or usage_error("Unable to create $conf_dir. Exiting.");
+ }
+
my $conf = slurp($conf_file) || '';
_fixup_conf($conf);