diff options
author | epoch <epoch@enzo.thebackupbox.net> | 2022-01-19 06:47:26 +0000 |
---|---|---|
committer | epoch <epoch@enzo.thebackupbox.net> | 2022-01-19 06:47:26 +0000 |
commit | 1d6837e369fe1d29f302311837573562ca05d870 (patch) | |
tree | 2ec19b741097ef4550c07bea35c8f1053318f66f /urititle | |
parent | e4581b75d2f157c724f2194002430841cb9dda16 (diff) | |
parent | c6b3499c83bd95bd111f3c658c6df68c4381992f (diff) | |
download | uritools-1d6837e369fe1d29f302311837573562ca05d870.tar.gz uritools-1d6837e369fe1d29f302311837573562ca05d870.zip |
Merge branch 'master' of ssh://git.thebackupbox.net/uritools
Diffstat (limited to 'urititle')
-rwxr-xr-x | urititle | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -74,8 +74,13 @@ magnet) ;; dns) if [ "$qs" ] ; then - export QUERY_STRING="$qs" - type="-t $(query_param "type")" + export QUERY_STRING="$(printf "%s\n" "$qs" | tr 'A-Z' 'a-z' | tr ';' '&')" + if [ "$(query_param type)" ];then + type="-t $(query_param "type")" + fi + if [ "$(query_param class)" ];then + class="-c $(query_param "class")" + fi fi if [ "$domain" ];then server="@$domain" @@ -83,7 +88,7 @@ dns) else server="" fi - dig $type "$path" +short $server | tr '\n' ' ' + dig $class $type "$path" +short $server | tr '\n' ' ' echo # the tr above strips out the trailing \n ;; ftp) @@ -136,6 +141,14 @@ ssh) fi printf "title: %s\n" "$(printf "" | nc "$domain" "$port" | head -n1)" ;; +file) + file="$(uriunescape "$path")" + if [ -e "$file" ];then + mime-type -v "$file" + else + printf "file '%s' doesn't exist.\n" "$file" + fi + ;; *) printf "DONT KNOW HOW TO GET TITLE FOR THIS URL: %s\n" "$1" esac |