One of the solutions to execute a bash script directly from a URL is:
bash <(curl -sS http://1.1.1.1/install)
The problem is that when curl fails to retrieve the url, bash get's nothing as input and it ends normally (return code 0).
I would like the whole command to abort with the return code from curl.
UPDATE:
Two possible solutions:
curl -sS http://1.1.1.1/install | bash; exit ${PIPESTATUS[0]}
or:
bash <(curl -sS http://1.1.1.1/install || echo "exit $?")
The last one is kind of hackish (but shorter)
bash <(curl -sS http://1.1.1.1/install || echo "exit $?"). Is there a better solution?bashfor execution.