--- install/consolefont | 26 +++++++++++--------------- 1 files changed, 11 insertions(+), 15 deletions(-) diff --git a/install/consolefont b/install/consolefont index f0512bb..b11bf0d 100644 --- a/install/consolefont +++ b/install/consolefont @@ -6,21 +6,17 @@ build() { FILES="" SCRIPT="consolefont" CONSOLEFONT=$( . /etc/rc.conf; echo "$CONSOLEFONT" ) - if [[ $CONSOLEFONT ]]; then - if [[ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz ]]; then - CONSOLEFONT_FILE_GZ=/usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz - CONSOLEFONT_FILE=$(mktemp ${TMPDIR}/consolefont.psfu.XXXXXX) - zcat "${CONSOLEFONT_FILE_GZ}" > "${CONSOLEFONT_FILE}" - add_file "${CONSOLEFONT_FILE}" /consolefont.psfu - elif [[ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz ]]; then - CONSOLEFONT_FILE_GZ=/usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz - CONSOLEFONT_FILE=$(mktemp ${TMPDIR}/consolefont.psf.XXXXXX) - zcat "${CONSOLEFONT_FILE_GZ}" > "${CONSOLEFONT_FILE}" - add_file "${CONSOLEFONT_FILE}" /consolefont.psf - else - echo "consolefont: Font file does not exist or does not end with .psf.gz or .psfu.gz." - fi - fi + [[ $CONSOLEFONT ]] || return 0 + local e + for e in psfu psf; do + CONSOLEFONT_FILE_GZ=/usr/share/kbd/consolefonts/$CONSOLEFONT.$e.gz + [[ -e $CONSOLEFONT_FILE_GZ ]] || continue + CONSOLEFONT_FILE=$(mktemp ${TMPDIR}/consolefont.$e.XXXXXX) + zcat "${CONSOLEFONT_FILE_GZ}" > "${CONSOLEFONT_FILE}" + add_file "${CONSOLEFONT_FILE}" /consolefont.$e + return + done + echo "consolefont: Font file does not exist or does not end with .psf.gz or .psfu.gz." } help () { -- 1.7.1