Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Illegal option #2

Open
BishiBosS96 opened this issue Nov 25, 2019 · 1 comment
Open

Illegal option #2

BishiBosS96 opened this issue Nov 25, 2019 · 1 comment

Comments

@BishiBosS96
Copy link

BishiBosS96 commented Nov 25, 2019

I am not able to deploy since the container cannot be started because of this,

./entrypoint.sh: 15: wait: Illegal option -n

This is my code
#!/usr/bin/env bash
set -ex
ssh -i ./ssh_key "cloud-proxy@${HTTP_PROXY}" \
-N -D ${HTTP_TUNNEL} \
-o StrictHostKeyChecking=no &
env HTTPS_PROXY="socks5://${HTTP_TUNNEL}" \
node index.js &
wait -n

What could be the problem? Thanks

@tek08
Copy link

tek08 commented May 19, 2020

I think wait takes a pid these days. instead of -n try $!. Presuming node didn't spawn any child processes, that should be the pid of the last command you ran. If it does start child processes, you can use a clever grep through ps, like:

PID=$(ps aux | grep "<something that identifies your process(es)>" | grep -v grep | tr -s " " | cut -d " " -f 2)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants