Since I have issues with my remote server [authorized_keys...] I wrote a script on my local machine that uses expect
command to ssh into the server and then perform cd
and then git pull
But I can't get this thing to work:
#!/usr/bin/expect
spawn ssh USER@IP_ADDRESS
expect {
"USER@IP_ADDRESS's password:" {
send "PASSWORD\r"
}
"[USER@server ~]$" {
send "cd public_html"
}
}
interact
Do I need to escape some chars? even when I try it still ignores the cd
command.