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