#! /bin/bash nginx_start content=$(fetch --with-headers) grep 'Index of /' <<< "${content}" # It is an index grep '\' <<< "${content}" # It contains a table grep '^ Content-Type:[[:space:]]*text/html' <<< "${content}"