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:
@ -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"
|
||||
|
Reference in New Issue
Block a user