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:
parent
41cf8f98bf
commit
a7daca90dd
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user