Script is never finishing

In one of my workflows, I need to setup a VPN connection at first, in order to access a company’s internal repository. I’m using the generic script runner step (https://github.com/bitrise-io/steps-script). All seems to work fine, installing, setting up and launching openconnect, but the script never ends. My build fails because of timeout.

I am not an bash expert (like, at all!) but I tried it in a local docker container and script works fine and finishes well.

Unfortunately I cannot provide the exact script as it references company configuration, but it looks like this:

apt-get install -y openconnect
echo -e $VPN | sudo openconnect [VPN_ADDRESS] --servercert [SHA1] &
# writing stuff to /etc/hosts and /etc/resolv.conf
wget [MY_INTERNAL_WEBSITE]

Build log shows that the script succeeded but current step never finishes and next step is never called. Does anybody have any idea why?

Hello there! it seems you make a connection and never drop it so it stays still. please try this:

echo -e $VPN | sudo openconnect [VPN_ADDRESS] --servercert [SHA1] &> $BITRISE_DEPLOY_DIR/logs.txt &
disown
# writing stuff to /etc/hosts and /etc/resolv.conf
wget [MY_INTERNAL_WEBSITE]
2 Likes

Thank you! It works like a charm!

(but I didn’t know each step induced a download of its own code, so when setting up VPN, next step still fails because of connection refused, but that’s another topic I will investigate now :wink: )

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.