20 lines
445 B
Bash
20 lines
445 B
Bash
#!/bin/sh
|
|
|
|
wrap_in_html_if_url()
|
|
{
|
|
case "$1" in
|
|
*://*)
|
|
FILE_ARGUMENT=$(mktemp)
|
|
|
|
echo -n '<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
|
|
echo -n '<meta HTTP-EQUIV="REFRESH" content="0; url=' > $FILE_ARGUMENT
|
|
echo -n "$1" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g' >> $FILE_ARGUMENT
|
|
echo '"/></html>' >> $FILE_ARGUMENT
|
|
;;
|
|
*)
|
|
FILE_ARGUMENT="$1"
|
|
;;
|
|
esac
|
|
}
|
|
|