added shell attribute to unit object definition to allow more flexibility; defaults to sh

This commit is contained in:
Master
2020-07-01 22:57:32 -04:00
parent c4828d506b
commit 3b467e2c0a
3 changed files with 11 additions and 15 deletions

View File

@@ -95,15 +95,10 @@ int Sproc::execute( std::string shell, std::string environment_file, std::string
return -401;
}
std::string sourcer_string = shell + " -c '. " + environment_file + "'";
slog.log( E_DEBUG, "Shell call for loading: ``" + sourcer_string + "``." );
int sourcer = system( sourcer_string.c_str() );
if ( sourcer != 0)
{
slog.log(E_FATAL, "Failed to source environment file.");
return -127;
}
exit_code_raw = system( command.c_str() );
std::string sourcer = shell + " -c \". " + environment_file + " && " + command + "\"";
slog.log( E_DEBUG, "Shell call for loading: ``" + sourcer + "``." );
std::cerr << sourcer.c_str() << std::endl;
exit_code_raw = system( sourcer.c_str() );
exit( WEXITSTATUS( exit_code_raw ) );
} else if ( pid > 0 )
{