1 Reply Latest reply: Oct 28, 2012 8:50 AM by Catch_22 RSS

    ilom password change -- my script

    Ani
      Hi,
      I am trying to prepare one expect script to change the ilom password but it is not working .please find the below script. actually it is stuck on "--> prompt .i think the bold line which i hv mentioned in the script is not correct , but not sure how to fix it

      ====================
      script:-
      ===============================================
      #!/usr/bin/expect -f
      set timeout -1

      set load_fh [ open "hosts" r ]
      set ip_list [ split [read $load_fh] "\n" ]
      close $load_fh

      foreach ip $ip_list {

      if { $ip != ""} {
      spawn ssh -oStrictHostKeyChecking=no root@$ip
      expect "assword*" {send "<root password>@1\r"}
      *expect "'->'" {send "set /SP/users/root password=<new password>1\r"}*
      expect "assword*" {send "<new password>\r"}
      expect "'->'" {send "exit\r"}
      }
      }
      =====================================
      this is the below o/p when i run it.i think it is stuck on -> prompt


      [root@xxxxxxx abcd]# ./ilom2.expect
      spawn ssh -oStrictHostKeyChecking=no root@xxxxxx1-ilom
      Password:

      Oracle(R) Integrated Lights Out Manager

      Version 3.0.16.10 r65138

      Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.

      ->

      [root@xxxxxx abcd]#
      =============================================