Shell script not taking input from terminal

editted the shell script.
issue - this curl command is working fine (taking input)
curl -s https://raw.githubusercontent.com/yaroslav-gwit/storj-node-helper-script/main/storj-node-helper-script.sh -o storj-node-helper-script.sh && bash storj-node-helper-script.sh

this is the edited file as per vpn which is not working:
curl -s https://raw.githubusercontent.com/anshikagupta26/storj-node-helper-script1/main/storj-node-helper-script1.sh -o storj-node-helper-script1.sh && bash storj-node-helper-script1.sh

1st curl command is working fine. Taking input data from terminal and all
But 2nd curl command which is nothing but same as 1st with some changes is not taking input data.

I just changed the internal port (28967) to my vpn’s port (as shown in the images).

these inputs are not being able to read.

plsss help

What do you mean? What error are you getting.
From what I see this:

docker run -d --restart unless-stopped -p 61268:28967 -p 61268:14002

can not work and is not the same from the original command. As you see these are different ports:

docker run -d --restart unless-stopped -p 28967:28967 -p 14002:14002

Oh and by the way the 14002 is the port for accessing the dashboard locally (127.0.0.1) which you probably don’t wanna expose through the VPN any way.

So should i remove the port for dashboard from my script?

docker run -d --restart unless-stopped -p 61268:28967 -p
Write just this instead?
And if that is the case then how will i access the dashboard

Even if im changing ports, does it hinder reading inputs too?

You need to provide what errors you are getting.


i’m just getting this output on running the command.

Hmmmm.

The funny thing is, I compared both files and they seem 100% equal except for the port numbers.
However the error messages you have posted indicate that there is an issue with the line endings, thus formatting.
Did you save the file in Windows? This could explain a change in formatting the EOL:

I have just tried it myself and it is weird indeed:
This is working:

curl -s https://raw.githubusercontent.com/yaroslav-gwit/storj-node-helper-script/main/storj-node-helper-script.sh -o storj-node-helper-script.sh && bash storj-node-helper-script.sh

This does not work:

curl -s https://raw.githubusercontent.com/anshikagupta26/storj-node-helper-script1/main/storj-node-helper-script1.sh -o storj-node-helper-script1.sh && bash storj-node-helper-script1.sh

My only idea now is that there is a different EOL handling on Github. I don’t use Github, so I cannot tell for sure. But maybe it is about this topic:
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

It seems that for some reason Github serves the first file with correct line ending while not with the second file.
Maybe others have better idea.

When I run the downloaded version manually I get:

./storj-node-helper-script1.sh
-bash: ./storj-node-helper-script1.sh: /bin/bash^M: bad interpreter: No such file or directory

When I remove the unvisible last character in that line then I can run it successfully:

./storj-node-helper-script1.sh
Enter your wallet address: xxx

So maybe you wanna check what is wrong with that first line, maybe you added a EOL in a different format when you have edited the file.

what is the invisible last character you are referring to here? can you pls elaborate.

./storj-node-helper-script1.sh
Enter your wallet address: xxx

and how to remove the unvisible last character in that line

It is invisible, so I cannot really tell.

To get rid of it, you would place the course at the end of the first line

#!/bin/bash

NC='\033[0m'
CYAN='\033[0;36m'

and delete everything between the end of line 1 and beginning of line 3:

#!/bin/bashNC='\033[0m'
CYAN='\033[0;36m'

and then add the empty line 2 again:

#!/bin/bash

NC='\033[0m'
CYAN='\033[0;36m'

This worked in my case and I was able to run the script.