I'm using the following library to do: http://maboiteaspam.github.io/ssh2-utils/
- Login to altus instance
- Go to a directory.
This is my code:
function postRun(url){
ssh.runMultiple(server, "sudo docker exec -it abcas /bin/bash", function(err,stdout,stderr,server,conn){
if(err) console.log(err);
stdout.on('data', function(data){
executeCommands();
});
stderr.on('data', function(data){
console.log(''+data);
});
stdout.on('close',function(data){
conn.end();
});
});
}
function executeCommands(){
ssh.runMultiple(server, ['cd /dependencies/scripts'], function(err,stdout,stderr,server,conn){
if(err) console.log(err);
stdout.on('data', function(data){
ssh.exec(server, 'pwd', function(err,stdout,stderr){
if(err) console.log(err);
});
});
stderr.on('data', function(data){
console.log(''+data);
});
stdout.on('close',function(data){
conn.end();
});
});
}
I get the following error:
bash: line 0: cd: /dependencies/scripts: No such file or directory
I am not sure what I'm doing wrong. I read somewhere that I need to change my shell but looks like I'm in bash already.
What am I missing, please enlighten.