Search code examples
bashenvironment-variablespleskshebanghubzilla

How to ignore shebang "#!/usr/bin/env bash" in a chrooted SSH Plesk hosted webspace environment


Is there any way to ignore a shebang from a script to run scripts globally via "/bin/bash"?

I have a PLESK-hosted webspace, with SSH chrooted to my web-home. I tried to install hubzilla, but most scripts in there return errors because they use the shebang

"#!/usr/bin/env bash"

In my home, "/usr" only contains a folder "/lib", and I do not have (nor will be granted) rights to create a matching directory or a symlink (bash is located in "/bin" and is standard interpreter for ssh). Adding

export PATH="$PATH:$HOME/bin"

to ".profile" does not solve the problem, either.

I could modify all scripts with that shebang to "#!/bin/bash" - But then I would have to re-do that after each update...? Is hubzilla just not for PLESK hosted webspaces? The hoster suggests a vserver, instead, but I want to avoid server administration.

Update: Problem solved by Barmar! Calling the script using bash directly works.

Overal solution for the use case at hand: Hubzilla's script (add_addon_repo - and probably others) calls further commands that are not available via SSH (next problem: git is not accessible via command line, just panel). So I guess hubzilla uses just more functionality than (at least this) webspace offers. So I will reactivate my vhost.


Solution

  • Run the script with bash explicitly, rather than as a command:

    /bin/bash scriptname