From 368f91c80e423b0c28adce84d087e0fa0ce66a51 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Wed, 18 Dec 2013 16:18:53 -0500 Subject: [PATCH] bin/haraka: simplify startup checks --- bin/haraka | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/bin/haraka b/bin/haraka index fbe29c16c..adcb39a2c 100755 --- a/bin/haraka +++ b/bin/haraka @@ -349,20 +349,10 @@ else if (parsed.configs) { var err_msg = "Did you install a Haraka config? (haraka -i " + base_dir +")"; if ( !fs.existsSync(base_dir) ) fail( "No such directory: " + base_dir + "\n" + err_msg ); - if ( ! fs.statSync(base_dir).isDirectory() ) - fail( "Not a directory at: " + base_dir + "\n" + err_msg ); - var config_dir = path.join(base_dir,'config'); - if ( !fs.existsSync( path.join(config_dir) ) ) - fail( "No config directory in: " + base_dir ); - if ( !fs.statSync( config_dir ).isDirectory() ) - fail( "Not a directory at: " + config_dir ); - - var smtp_ini = path.join(config_dir, 'smtp.ini'); + var smtp_ini = path.join(base_dir,'config','smtp.ini'); if ( !fs.existsSync( smtp_ini ) ) - fail( "No smtp.ini in: " + config_dir ); - if ( !fs.statSync( smtp_ini ).isFile() ) - fail( "Not a file at: " + smtp_ini ); + fail( "No smtp.ini at: " + smtp_ini + "\n" + err_msg ); process.argv[1] = haraka_path; process.env.HARAKA = parsed.configs;