- fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
- if [ ! -z "$fav" ];then
- user="$fav $user"
+ timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null > $tmpfile3
+ timeoutstatus=${PIPESTATUS[0]}
+ if [ $timeoutstatus -ne 124 ];then
+ local newuser=$(cat $tmpfile3 | grep -m 1 author: | awk -F ":" '{print $2}' )
+ local newavatar=$(cat $tmpfile3 | grep -m 1 avatar: | awk -F ":" '{print $2}' )
+ if [[ $newuser != "" ]]
+ then
+ newuser=$(echo "$newuser" | xargs)
+ newavatar=$(echo "$newavatar" | xargs)
+ user="$newavatar $newuser"
+ else
+ fav=$(timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
+if [ ! -z "$fav" ];then
+ user="$fav $user"
+ fi
+