core-agent-linux/qubes-rpc/wrap-in-html-if-url.sh
Marek Marczykowski-Górecki e2ab963a27
Minor improvements to packaging (based on rpmlint)
There is much more to fix, but lets start with low hanging fruits.
2015-11-11 15:19:43 +01:00

19 lines
277 B
Bash

#!/bin/sh
wrap_in_html_if_url()
{
case "$1" in
*://*)
FILE_ARGUMENT=$(mktemp)
echo -n '<html><meta HTTP-EQUIV="REFRESH" content="0; url=' > $FILE_ARGUMENT
echo -n "$1" >> $FILE_ARGUMENT
echo '"></html>' >> $FILE_ARGUMENT
;;
*)
FILE_ARGUMENT="$1"
;;
esac
}