Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_repo Bash script needs Bash Shebang to run straight from the shell #2142

Open
Gitsarry opened this issue Dec 29, 2024 · 0 comments
Open

Comments

@Gitsarry
Copy link

OS: Debian Bullseye

According to
https://i2pd.readthedocs.io/en/latest/user-guide/install/ -> Debian section
and
https://repo.i2pd.xyz/.help/readme.html

one should download and run the script "add_repo" with the Bash interpreter, using the following command:

$ wget -q -O - https://repo.i2pd.xyz/.help/add_repo | sudo bash -s -

(note the "bash" command here)

Since I like to see a script before I download it from the internet and run it as root, I downloaded it manually with just

$ wget -q https://repo.i2pd.xyz/.help/add_repo
reviewed it, made it executable with chmod +x add_repo and then did sudo ./add_repo
But that exits with the error:

./add_repo: 3: [[: not found
./add_repo: 9: source: not found
./add_repo: 11: function: not found
./add_repo: 30: [[: not found
./add_repo: 30: : Permission denied
./add_repo: 62: [[: not found
./add_repo: 66: Syntax error: "}" unexpected

That's because the add_repo script has the #!/bin/sh shebang, and that symlinks to /bin/dash on Debian Bullseye and Dash does not understand the if clause with double brackets like if [[ $EUID -ne 0 ]]; then.

Since Bash is mandatory and documented, I would suggest to set the shebang in add_repo to #/bin/bash accordingly.

Workaround would be to run sudo bash ./add_repo but that's unnecessary complicated and I do not see a reason why not to define the proper Shebang in the script itself.

I did not find a github repo for https://repo.i2pd.xyz/.help/add_repo, if I had, I would have created a pull request already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant