๐ How can a bash script ssh command fail by just changing the script name?
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
I have a deploy script that does many things. One of the things it does is running some scripts in the server.
So I have this line:
sshpass -p $PASSWORD ssh $SERVIDOR_USUARIO@$SERVIDOR_IP sudo $SERVIDOR_PASTA/../$SCRIPT_RM
and a bit above I have this line
SCRIPT_RM=utilities-rm
which loads the SCRIPT_RM var with the script name. Other lines fill the other vars.
This runs perfectly well. Now if I just rename the script for say utilities-rm2 (both in the script and server obviously) it fails with this error:
sudo: no tty present and no askpass program specified
which is the same error as if it didnยดt find the file.
If you're thinking it can't be pointing to that file, I double checked it by maintaining the name in the local script and renaming file in server. It failed. When I renamed it again it worked. :O Also there's no other file with that name in the server
Don't believe me ? here a video of the bug: https://www.youtube.com/watch?v=OYXbI_tLJH4
What in God's name is happening here ?
[link] [comments] ...