Technical data

8. Documentation for Developers
if (opt_sshd)
then
foreach pkf in sshd_public_keyfile_%
do
stat("$config_dir/etc/ssh/$pkf", publickeyfile)
if(publickeyfile_res == "OK")
then
add_to_opt "etc/ssh/$pkf" "mode=400 flags=utxt"
else
error "sshd: missing public keyfile %pkf=$pkf"
fi
done
fi
stat (Page 305) at first checks for the file existing in the configuration directory. If it is, it
will be included in the archive, if not, mkfli4l will abort with an error message.
Hint: Also for add_to_opt mkfli4l will first check (Page 291) if the file to be copied can
be found in the configuration directory.
Filenames as well flags passed as string constants are subject of variable substitution
(Page 300).
Control Flow
if (expr)
then
statement
else
statement
fi
A classic case distinction, as we know it. If the condition is true, the then part is executed,
if the condition is wrong the else part.
If you want to run tests on array variables, you have to test every single variable. The
foreach loop in two variants for this.
1. Iterate over array variables:
foreach <control variable> in <array variable>
do
<instruction>
done
foreach <control variable> in <array variable-1> <array variable-2> ...
do
<instruction>
done
This loop iterates over all of the specified array variables, each starting with the first
to the last element, the number of elements in this array is taken from the N-variable
309