rubbersoul69
IS-IT--Management
Hi All,
I'm writing an expect script for an installation of some software on a Linux box. Where I'm getting stuck is in the beginning when I'm looking for the presence of a file. If it's there I want to rename it to acme.conf.1, so that when the software installs it can touch acme.conf.
Hope someone can help here.....
#!/usr/local/bin/expect
set authFile "/etc/acme.conf"
if {![file exists $authFile]} { ;# Does file not exist
set
Need say do nothing here
else
send "/etc/psynch.conf" "/etc/psynch.conf1"
}
#connect to system
spawn ssh root@10.10.42.27\r
#modify line below if you have already added system fingerprint to known hosts.
expect "Please type 'yes' or 'no':"
send yes\r
expect "password: "
send 5555555\r
expect "linux-zwny:~ #"
That's the basis of it...you can see where im stuck at the top.
I'm writing an expect script for an installation of some software on a Linux box. Where I'm getting stuck is in the beginning when I'm looking for the presence of a file. If it's there I want to rename it to acme.conf.1, so that when the software installs it can touch acme.conf.
Hope someone can help here.....
#!/usr/local/bin/expect
set authFile "/etc/acme.conf"
if {![file exists $authFile]} { ;# Does file not exist
set
Need say do nothing here
else
send "/etc/psynch.conf" "/etc/psynch.conf1"
}
#connect to system
spawn ssh root@10.10.42.27\r
#modify line below if you have already added system fingerprint to known hosts.
expect "Please type 'yes' or 'no':"
send yes\r
expect "password: "
send 5555555\r
expect "linux-zwny:~ #"
That's the basis of it...you can see where im stuck at the top.