I currently have the following
if (!RunCommand(LogonAsAServiceCommand))
return;
if (!ServicesRunningOrStart())
return;
if (!ServicesStoppedOrHalt())
return;
if (!BashCommand(CreateRuntimeBashCommand))
return;
if (!ServicesStoppedOrHalt())
return;
if (!BashCommand(BootstrapDataBashCommand))
return;
if (!ServicesRunningOrStart())
return;
would it be cleaner to do this? is it safe?
if (
(RunCommand(LogonAsAServiceCommand))
&& (ServicesRunningOrStart())
&& (ServicesStoppedOrHalt())
&& (BashCommand(CreateRuntimeBashCommand))
&& (ServicesStoppedOrHalt())
&& (BashCommand(BootstrapDataBashCommand))
&& (ServicesRunningOrStart())
)
{
// code after "return statements" here
}