# Script is never finishing

**URL:** <https://discuss.bitrise.io/t/script-is-never-finishing/6300>\
**Category:** Tooling Issues\
**Tags:** step, script\
**Created:** [September 26, 2018, 8:45am UTC](https://discuss.bitrise.io/t/script-is-never-finishing/6300 "2018-09-26T08:45:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfesquet](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nfesquet](https://discuss.bitrise.io/u/nfesquet)\
**Post date:** [September 26, 2018, 8:45am UTC](https://discuss.bitrise.io/t/script-is-never-finishing/6300/1 "2018-09-26T08:45:26Z")

</div>

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](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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![fehersanyi-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/fehersanyi-bitrise/32/1912_2.png) [@fehersanyi-bitrise](https://discuss.bitrise.io/u/fehersanyi-bitrise)\
**Post date:** [September 26, 2018, 12:00pm UTC](https://discuss.bitrise.io/t/script-is-never-finishing/6300/2 "2018-09-26T12:00:23Z")

</div>

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

```auto
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]

```

---

<div class="post-metadata">

**Author:** ![nfesquet](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nfesquet](https://discuss.bitrise.io/u/nfesquet)\
**Post date:** [September 26, 2018, 12:58pm UTC](https://discuss.bitrise.io/t/script-is-never-finishing/6300/3 "2018-09-26T12:58:39Z")

</div>

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 😉 )

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [October 26, 2018, 12:58pm UTC](https://discuss.bitrise.io/t/script-is-never-finishing/6300/4 "2018-10-26T12:58:40Z")

</div>

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