diff options
| author | Leah Rowe <leah@libreboot.org> | 2025-05-04 08:33:17 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2025-05-04 08:33:17 +0100 | 
| commit | 7392f6fc8ecbff10661be6ae66306afd89f1a3e3 (patch) | |
| tree | 9e18c96a79eb8b260a4cae0aa3f1a8ca2e962304 /include/lib.sh | |
| parent | 7acec7a3a1d40a38b88b56e9c56087da263f30d1 (diff) | |
init.sh: move non-init functions to lib.sh
these were missed in a previous cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
| -rw-r--r-- | include/lib.sh | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/include/lib.sh b/include/lib.sh index 50813352..93680cee 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,6 +128,22 @@ setvars()  	printf "%s\n" "${_setvars% }"  } +setcfg() +{ +	[ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2" +	[ $# -gt 1 ] || \ +		printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err" +	printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err" +} + +chkvars() +{ +	for var in "$@"; do +		eval "[ -n \"\${$var+x}\" ] || \$err \"$var unset\"" +		eval "[ -n \"\$$var\" ] || \$err \"$var unset\"" +	done; : +} +  fe_()  {  	find_ex "x_" "$@" | 
