PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 13, 2022

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

 November 13, 2022     bash, environment-variables, hubzilla, plesk, shebang     No comments   

Issue

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


Answered By - Barmar
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing