wrap-in-html-if-url.sh 266 B

12345678910111213141516
  1. wrap_in_html_if_url()
  2. {
  3. case "$1" in
  4. *://*)
  5. FILE_ARGUMENT=$(mktemp)
  6. echo -n '<html><meta HTTP-EQUIV="REFRESH" content="0; url=' > $FILE_ARGUMENT
  7. echo -n "$1" >> $FILE_ARGUMENT
  8. echo '"></html>' >> $FILE_ARGUMENT
  9. ;;
  10. *)
  11. FILE_ARGUMENT="$1"
  12. ;;
  13. esac
  14. }