I'm trying to use capistrano to deploy on a shared host. However the ssh connection seems not to be standard, when I connect with the terminal, it asks me to press Enter to continue, and this seems to prevent Capistrano from working. Here's the console output:
Asking for console, please wait
Connected
Grabbing terminal
Ok
Press [Enter] to start a shell
hosting-user#paas_12345:~$
Any idea on how I could hack Capistrano to press the Enter key just after login? Or at least some ideas about what this strange terminal technology is?
Related
I have a bash script that helps install a few applications automatically.
One app requests that I press ENTER to continue, or CTRL+C to cancel.
How can I automate my script to press ENTER when that prompt comes up?
For simple enter or confirmation, consider using the yes command:
yes '' | command_or_script
For automating more complex interactions, consider using expect.
See: https://stackoverflow.com/a/7013379/7939871
I have a bash script that I have to regularly run on a remote server. Part of the script includes running a backup which takes a while, and after it has run, I have to hit "Y" to confirm that the backup worked before the script will continue.
I would like to know if there is a way to get my laptop to make a beep (or some sort of sound) when that happens. I know that echo -e '\a' makes a beep, but if I run it from within a script on the remote server, the beep happens on the remote server.
I have control of the script that is being run, so I could easily change it to do something special.
You could send the command through ssh back to your computer like:
ssh user#host "echo -e '\a'"
Just make sure you have ssh key authentication from your server to your computer so the command can run smoothly
In my case the offered solutions with echo didn't work. I'm using a macbook and connect to an ubuntu system. I keep the terminal open and I'd like to be informed when a long running bash script is ready.
What I did notice is that if I shutdown the remote system then it will beep the macbook and show an alarm icon on the relevant tab. So I have now implemented a bit of dirty workaround:
sudo shutdown 1440 && shutdown -c
This will initiate the system to shutdown and will immediately cancel the request. And I do get the alarm beep + icon. You will need to setup sudo to allow the user to permit shutdown. As it was my own remote server it was no problem but could limit the usability for others.
I am using Git Bash on Windows.
I just verified my Heroku account,
then I open git bash and type:
$ heroku login
bash responds:
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/browser/c31ddaf9-7a55-4daf-afad-a0500e924c26
heroku: Waiting for login...
Logging in... done
Logged in as [my mail address]
and then, I can type whatever I want, but it does not get and execute the command, behaving like a text editor. Then, when I click on the cross to close it, a warning message appears, telling that some processes are still going on.
How do I unlock the freezing and go on using Bash?
I solved it by hitting CTRL+C to break out and chose yes (type y).
It turns out that the git bash terminal has the frequent problem of turning "frozen" after you enter a command.
Whenever it happens, you should press CTRL+C
I am trying to quit a program with a bash script. The problem is that it has to be quit via the the x-button to save some settings. So pkill program do not work in my case. I know that I have to sent a signal for the x-button but I can not find witch one.
What's the best way to run this shell script where I need to create an output log at the same time run it in the background? The catch is, I need to input a couple of parameters then enter a password.
For example I execute the shell script like so:
-bash-4.3$ ./tst.sh param1 param2 >> tst.log
Password for user mas:
I need to pass in (2) parameters, then prompted for a password:
./tsh.sh <param1> <param2>
This will work, but I have to keep the session open and I want it so it goes to the background or something similar where it will continue to run if my connection to the host fails..
If you want to run something that will survive if your connection fails you should run it in a screen or tmux session. You can use those to create sessions that you can disconnect from and reconnect to, and many other really cool things once you start really getting into them.
So if you ssh in and then run screen you'll still be at a bash prompt, but if you run a command then press ^a^d you will detach from that session. Everything running inside screen will keep going, and you'll be able to reconnect with screen -x later. You can have many screen sessions at the same time too, use screen -ls to see which are running then you can use screen -x <id> to reconnect to a particular one.