diff options
author | Matthieu Crapet <mcrapet@gmail.com> | 2015-03-31 15:26:23 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-03-31 16:07:23 +0200 |
commit | f5437680748a3c775bdcb74022f3e09a69ba27a3 (patch) | |
tree | 84588b9cf84584e0e987f4f2f757dd1797e3b447 /fbgs | |
parent | 8b732a2e31c3a3c0061fe341898afb9d731320fd (diff) | |
download | fbida-2.10.tar.gz |
fbgs: minor changes2.10
- don't require /bin/bash but /bin/sh (used checkbashisms and tested using /bin/dash)
- check if file argument exists
- print help message when no argument given
Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'fbgs')
-rwxr-xr-x | fbgs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # PostScript/pdf viewer for the linux framebuffer console @@ -18,7 +18,7 @@ passwd="" device="png16m" opt=1 bell="off" -helptext=" +helptext="\ This program displays PostScript/pdf files using the linux framebuffer device. It is a simple wrapper script for GhostScript and fbi. @@ -38,6 +38,7 @@ usage: fbgs [fbgs options] [fbi options] file Read the fbgs(1) and fbi(1) manpages for more details. " +[ $# -ne 0 ] || set -- -h while test "$opt" = "1"; do case "$1" in # fbgs options @@ -114,6 +115,11 @@ while test "$opt" = "1"; do esac done +if [ ! -f "$1" ]; then + echo "fbgs: cannot stat '$1': No such file or directory" + exit 1 +fi + # run ghostscript echo echo "### rendering pages, please wait ... ###" |