init: Remove support for 'Script' parameters
All checks were successful
continuous-integration/drone/push Build is passing

This can now be changed to good old 'Command', putting a shebang into the script,
thanks to the new shebang support in the kernel.
This commit is contained in:
apio 2023-07-30 18:47:38 +02:00
parent 3638d3da46
commit 3598dacbed
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -175,28 +175,10 @@ static Result<void> load_service(const os::Path& path)
if (parts[0].view() == "Command")
{
if (!service.command.is_empty())
{
do_log("[init] 'Command' cannot be specified after 'Script' has already been set! (%s)\n",
line.chars());
return {};
}
service.command = move(parts[1]);
continue;
}
if (parts[0].view() == "Script")
{
if (!service.command.is_empty())
{
do_log("[init] 'Script' cannot be specified after 'Command' has already been set! (%s)\n",
line.chars());
return {};
}
service.command = TRY(String::format("/bin/sh -- %s"_sv, parts[1].chars()));
continue;
}
if (parts[0].view() == "Restart")
{
if (parts[1].view() == "true" || parts[1].view().to_uint().value_or(0) == 1)