         expect "*% " {send -s "exit\r"}
       }
     }
-     send_user "\n#### $host in total has $errorperhost errors ####\n"
+    send_user "\n#### $host in total has $errorperhost errors ####\n"
     expect "*> " { send -s "exit\r"}
   }
 }

proc counterrors {pattern logs} {
  set errorcount 0
  foreach line [split $logs "\n"] {
    if { [regexp $pattern $line] } {
      incr errorcount 1
    }

    spawn telnet $host

    expect timeout {
      send_user "\n$host: CONNECTION ERROR - connection timeout\n"
      continue
    } eof {
      send_user "\n$host: CONNECTION ERROR - got eof\n"
      continue
    } "Login incorrect" {
      send_user "\n$host: CONNECTION ERROR - wrong credentials\n"
      continue
    } "Permission denied, please try again." {
      send_user "\n$host: CONNECTION ERROR - wrong credentials\n"
      continue 
    } "Are you sure you want to continue connecting (yes/no)?" {
      send -s "yes\r"
