# The shell script in html format is returned after the oneagent download command is executed

**URL:** <https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640>\
**Category:** Open Q&A\
**Tags:** installation\
**Created:** [March 1, 2023, 3:12am UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640 "2023-03-01T03:12:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![samandqq](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@samandqq](https://community.dynatrace.com/u/samandqq)\
**Post date:** [March 1, 2023, 3:12am UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640/1 "2023-03-01T03:12:09Z")

</div>

wget -O Dynatrace-OneAgent-Linux-1.257.250.sh “[https://xxxxxx/e/1bde8062-2746-42a9-a9c6-xxxxx/api/v1/deployment/installer/agent/unix/default/latest?arch=x86&flavor=default](https://xxxxxx/e/1bde8062-2746-42a9-a9c6-xxxxx/api/v1/deployment/installer/agent/unix/default/latest?arch=x86&flavor=default)” --header=“Authorization: Api-Token dt0c01.xxx.xxxxx”

Dynatrace-OneAgent-Linux-1.257.250.sh script:

```markup
<script language="JavaScript" type="text/javascript">
    function redirectF()
{
        var target="HTTPS://xxx/e/xxx8/api/v1/deployment/installer/agent/unix/default/latest/metainfo?api-token=dt0c01.xxx.xxx";
        document.cookie="RELAYSTATE=" + escape(target) + ";secure";
        document.location.replace("https://xxxxxx/login?authenticateUsingSso");

}
</script>

<body onload="redirectF()">
</body>

```

---

<div class="post-metadata">

**Author:** ![alexander\_dt](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexander\_dt](https://community.dynatrace.com/u/alexander_dt)\
**Post date:** [March 7, 2023, 2:19pm UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640/2 "2023-03-07T14:19:24Z")

</div>

Hi&nbsp;[@samandqq](https://community.dynatrace.com/user/60167),

Sorry for the late response. Assuming your path is&nbsp; **/e/1bde8062-2746-42a9-a9c6-xxxxx/api/v1/deployment/installer/agent/unix/default/latest?arch=x86&flavor=default** , that should be the right one.

I presume you copied the wget call from the UI, but did you still verify the access token is correct? Usually there should be a clear error message if it is not, but it might be worth verifying that.

Other than that, that HTML document should actually not originate from Dynatrace, could it be that you have some else (proxy?) in place which enforces an SSO login?

You could also use curl instead of wget and pass the “.-ivk” parameters to get more insight on the connection and verify you are actually talking to the Dynatrace machine and not a proxy. Verify the certificates as well.

---

<div class="post-metadata">

**Author:** ![Erik\_Soderquist](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/erik_soderquist/32/36772_2.png) [@Erik\_Soderquist](https://community.dynatrace.com/u/Erik_Soderquist)\
**Post date:** [March 7, 2023, 2:52pm UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640/3 "2023-03-07T14:52:02Z")

</div>

Hi [@samandqq](https://community.dynatrace.com/user/60167) ,

To me this looks like there is some MitM device interfering.

I just tested against my own Managed Cluster, and was unable to reproduce this.

- A valid token without the correct access gets the expected http/403 forbidden
- A valid token with the correct access gets the install package
- An invalid token gets the expected http/401 unauthorized.

As an API endpoint accepting tokens only, a redirect to SSO should not be returned.&nbsp; However, an MitM device such as a proxy that requires authentication _would_ redirect to authentication without any awareness that the requested URL is an API endpoint.

I second [@alexander\_dt](https://community.dynatrace.com/user/59135) recommendation to switch to using curl with the -ikvvv switches to see exactly what you are connecting to.

-- Erik

---

<div class="post-metadata">

**Author:** ![alexander\_dt](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexander\_dt](https://community.dynatrace.com/u/alexander_dt)\
**Post date:** [March 15, 2023, 1:16pm UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640/4 "2023-03-15T13:16:05Z")

</div>

[@samandqq](https://community.dynatrace.com/user/60167),&nbsp;did you manage to fix it? Was it a proxy?

---

<div class="post-metadata">

**Author:** ![samandqq](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@samandqq](https://community.dynatrace.com/u/samandqq)\
**Post date:** [March 16, 2023, 12:15am UTC](https://community.dynatrace.com/t/the-shell-script-in-html-format-is-returned-after-the-oneagent-download-command-is-executed/38640/5 "2023-03-16T00:15:55Z")

</div>

Yes, it’s proxy, thanks a lot.
