e9fc8399680060ce94fe0757e269a7fb2c42af8b
[ossec-hids.git] / src / agentlessd / scripts / sshlogin.exp
1 #!/usr/bin/env expect
2
3 # @(#) $Id$
4 # Agentless monitoring
5 #
6 # Copyright (C) 2009 Trend Micro Inc.
7 # All rights reserved.
8
9 # This program is a free software; you can redistribute it
10 # and/or modify it under the terms of the GNU General Public
11 # License (version 2) as published by the FSF - Free Software
12 # Foundation.
13
14
15 expect {
16     "Permission denied" {
17         send_user "\nERROR: Incorrect password to remote host: $hostname .\n"
18         exit 1;
19     }
20     eof {
21         send_user "\nERROR: EOF while logging to host: $hostname .\n"
22         exit 0;
23     }
24     timeout {
25         send_user "\nERROR: Timeout while running on host: $hostname .\n"
26         exit 1;
27     }
28     "*\\\$" {
29         send_user "\nINFO: Started.\n"
30     }
31     "*#" {
32         send_user "\nINFO: Started.\n"
33     }
34 }