Hi all,

Let's have the following case: the environment variable $FOO can be defined but it doesn't have to be. Then I want to pass this variable to a process in the unit file like "--foo $FOO", but only if the variable is not empty. Something like the following has been done in the SysV init script:

if [ "$FOO" ]; then
  MYARGS="--foo $FOO"
fi

Do I have to create the same bash script and execute it like:
ExecStartPre=/path/to/simple/script
ExecStart=/path/to/daemon $MYARGS

or is there any better way how to do it?

Thanks,

Honza
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to