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

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