aboutsummaryrefslogtreecommitdiffstats
path: root/fbgs
diff options
context:
space:
mode:
authorMatthieu Crapet <mcrapet@gmail.com>2015-03-31 15:26:23 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-03-31 16:07:23 +0200
commitf5437680748a3c775bdcb74022f3e09a69ba27a3 (patch)
tree84588b9cf84584e0e987f4f2f757dd1797e3b447 /fbgs
parent8b732a2e31c3a3c0061fe341898afb9d731320fd (diff)
downloadfbida-38cd6cabb3d5aa194cd4b42ab95db6dcbe95eb82.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-xfbgs10
1 files changed, 8 insertions, 2 deletions
diff --git a/fbgs b/fbgs
index 3b996b5..49fae6a 100755
--- a/fbgs
+++ b/fbgs
@@ -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 ... ###"