From 2ba2be900664415dc5a34cc2cfdb82ecab3c4ce5 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Sun, 3 Nov 2019 04:46:15 +0100 Subject: Add support for a custom font at boot Signed-off-by: Thomas Deutschmann --- gen_funcs.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gen_funcs.sh') diff --git a/gen_funcs.sh b/gen_funcs.sh index b47f698..107f02b 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -251,6 +251,28 @@ is_gzipped() { echo "${file_is_gzipped}" } +is_psf_file() { + [[ ${#} -ne 1 ]] \ + && gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly one argument (${#} given)!" + + local file_to_check=${1} + + if [ ! -f "${file_to_check}" ] + then + gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): File '${file_to_check}' does not exist!" + fi + + local file_is_psf=no + local file_brief=$(file --brief "${file_to_check}" 2>/dev/null) + + if [[ "${file_brief}" == *"PC Screen Font"* ]] + then + file_is_psf=yes + fi + + echo "${file_is_psf}" +} + is_valid_ssh_host_keys_parameter_value() { local parameter_value=${1} -- cgit v1.2.3-65-gdbad