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

Script ends with cancelled by user #2

Closed
sml156 opened this issue Jul 16, 2017 · 10 comments
Closed

Script ends with cancelled by user #2

sml156 opened this issue Jul 16, 2017 · 10 comments

Comments

@sml156
Copy link

sml156 commented Jul 16, 2017

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:

root@LEDE:~# curl -k -sSL  https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh | sh

Simple OPKG Updater v0.2.3

Done | Updating package lists
Done | Getting upgradable packages list

Packages available for upgrade: 13

luci-lib-ip - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-theme-bootstrap - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
dnsmasq - 2.77-1 - 2.77-2
luci-app-firewall - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
odhcp6c - 2017-01-30-c13b6a05-1 - 2017-01-30-c13b6a05-2
dropbear - 2017.75-1 - 2017.75-2
luci-proto-ppp - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-mod-admin-full - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-base - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-proto-ipv6 - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-lib-nixio - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-lib-jsonc - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1


Cancelled by user!

root@LEDE:~#
@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

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.

@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

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

@sml156
Copy link
Author

sml156 commented Jul 23, 2017

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

@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

Sweet!
Thanks for posting, good to know it does not work like that anyways.
Cheers!

@sml156
Copy link
Author

sml156 commented Jul 23, 2017

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.

https://github.com/pi-hole/pi-hole

@sml156
Copy link
Author

sml156 commented Jul 23, 2017

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

@sml156 sml156 closed this as completed Jul 23, 2017
@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

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

@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

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.

@tavinus
Copy link
Owner

tavinus commented Jul 23, 2017

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.

@sml156 sml156 reopened this Jul 23, 2017
@sml156 sml156 closed this as completed Jul 23, 2017
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

2 participants