Skip to content

Commit

Permalink
bin/haraka: simplify startup checks
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Dec 18, 2013
1 parent bd8f2ac commit 368f91c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions bin/haraka
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 368f91c

Please sign in to comment.