Closed sml156 closed 7 years ago
Hi! sorry for the late response!
Humm...
I never really tried to run it "directly from the internet".
Does the same thing happen if u try to run it locally?
I mean if u download first and then try to run it locally?
You should be asked if you want to install the updates at that point.
I will try to reproduce it here soon.
Hi again! Just made a test piping it to sh
and I got the same problem.
I am not sure why it does not ask when piping the script.
I am also not sure how to pass a parameter when running like that (you could tell it to install without asking with that).
I would ask you to just download the script and then run it locally instead of directly piping it from curl or wget. So, you can use curl or wget to download as described on the readme, or even use git to clone the repo. Then you can just call it with or without parameters.
If you still want to download and run at once, I would recommend using something like this:
curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh -o ./opkg-upgrade.sh && chmod +x ./opkg-upgrade.sh && ./opkg-upgrade.sh
This will download, set to executable and run (on the current directory).
Tested and working!
Hope this helps!
Cheers!
Gus
Ok, so this seems to be normal to happen in this case.
References:
Because there is not stdin for read
to process the response when run like that.
Tell me what you think.
Thanks for your response, I have not tried to run it locally but I will try the script you just posted thank you.
Update: I tried the command you posted above and it worked perfectly Thank you
Sweet!
Thanks for posting, good to know it does not work like that anyways.
Cheers!
I will read the links you posted soon.
I was hoping it would work the same as it does in Ubuntu, I use a DNS server called Pihole and that's how it's installed.
You should also put that command on your Readme page as long as people have curl installed it works great.
opkg update
opkg install curl
curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh -o ./opkg-upgrade.sh && chmod +x ./opkg-upgrade.sh && ./opkg-upgrade.sh
DONE
As far as I can tell the problem is only with read
, which is used to ask for permission to install the updates. When you pipe it to sh
another shell is created and stdin is not "redirected" so there is no response (or at least no Y/y response) on which case the script thinks something other than Y was the response.
The download call is basically the same I have on the readme, but without using variables and this one runs the script after downloading. I think it is less intrusive that way, but who knows. The better way is always to use git in any case, but not really needed.
I also have an explanation for the curl -k
option to ignore SSL certificates and all there. I believe this should not be default as many people may not realize there is a security risk there.
Cheers!
Gus
Just a side note. This would also happen in any other linux distro (including ubuntu). Pihole works because it does not ask anything for the user (or he would have the same problem with read not receiving the answer I think). I would need a separate installer script for you to run like that.
Same approach is used by get.acme.sh (LetsEncrypt SH script). He has an installer on http://get.acme.sh which install the acme.sh script itself.
So, in any case, running the installer like that would not run the script itself.
Also, he uses a variable to pass a parameter, as in:
curl https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh | INSTALLONLINE=1 sh
That INSTALLONLINE=1
there.
But note that he has to do it after the pipe.
I tried your script but it does not ask me if I want to install updates it just say's cancelled by user, Any guidence would be appreciated.
This is the command I used:
curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh | sh
A little bit about my install and my router:
LEDE/OpenWRT Model | TP-Link TL-WDR4300 v1 Firmware Version | LEDE Reboot 17.01.2 r3435-65eec8bd5f / LuCI lede-17.01 branch (git-17.152.82987-7f6fc16) Kernel Version | 4.4.71
Running your script using curl: