diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-11-21 15:45:16 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-11-21 15:45:16 +0100 |
commit | 6c3cf46438ab49624004db8b614c261609328eec (patch) | |
tree | def74a99b5229890213bacabc4e22d18f88b5eae | |
parent | c039c70dd4919e7ec4c270d2f27de028a448754c (diff) | |
download | impressive-display-6c3cf46438ab49624004db8b614c261609328eec.tar.gz impressive-display-6c3cf46438ab49624004db8b614c261609328eec.tar.bz2 impressive-display-6c3cf46438ab49624004db8b614c261609328eec.zip |
impressive-display: Validate PDF_URI before using it with curl.
-rwxr-xr-x | bin/impressive-display | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/impressive-display b/bin/impressive-display index f04f683..58411e7 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -157,6 +157,12 @@ else RESOLUTION="$DEFAULT_RESOLUTION" fi +if ! echo "$PDF_URI" | grep -E "^(file://|http://|https://).*"; then + $OUTPUT "ERROR: PDF_URI format not supported: $PDF_URI" + $OUTPUT " Use file://<path>/<file>.pdf(.gz) or http(s)://<host>/<path>/<file>.pdf. Doing nothing." + exit -1 +fi + if [ -n "${RESOLUTION}" ]; then if type -p xrandr 1>/dev/null; then xrandr -d :0 --output "$(echo $currentOutput)" --mode $RESOLUTION |