Fix prompt when executing the deployment with the password

`sudo -S` reads the password from stdin. The way it was it was executing
the deploy script with the password as the stdin of the pipe.

Now, when password is passed as an argument we aquire a sudo session
executing a command that always work and then prefixing the installation
with sudo.
This commit is contained in:
Bruno Tavares 2015-09-26 23:35:05 -03:00
parent 41cf8f98bf
commit a7daca90dd

View File

@ -1,7 +1,7 @@
#!/bin/bash -e
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
[[ "$1" == "--password" ]] && shift && prefix="echo \"$1\" | sudo -S " && shift
[[ "$1" == "--password" ]] && shift && prefix="echo \"$1\" | sudo -S true && sudo " && shift
target=$1
[ "$target" ] || echo "Please, provide an ssh target"