wrap_in_html_if_url.sh 271 B

1234567891011121314151617
  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. }