Closed tristanlatr closed 4 years ago
There is some weird errors on the install script with Rasbian...
sh: 30: read: arg count
Hello,
I think the script is now stable on most unix systems.
You can try this version with sh -c "$(curl -sSL https://raw.githubusercontent.com/lukaspustina/wpscan-analyze/41b8647ee8cccd4e24a3b3b51aa35b960098e974/install.sh)"
Now it's sh -c "$(curl -sSL https://raw.githubusercontent.com/lukaspustina/wpscan-analyze/fb8bff45d9dce67829c9cccd4f56511d4fc958f8/install.sh)"
Hi, @lukaspustina The install script is currently not working. Could you review and merge this pr ?
I'm not sure about the contracts of the install script, but if try to re-run the script, I get this:
[lukas] /tmp → sh ./install.sh
[INFO] wpscan-analyze install script for MacOS and Linux
[INFO] wpscan-analyze in already installed: /Users/lukas/.cargo/bin/wpscan-analyze (wpscan-analyze 1.0.4)
[INFO] The script will remove this installation
[ERROR] You already have the latest wpscan-analyze version. If you're looking for the dev version please install it manually.
This seems odd, as the script says it's going to remove the current installation, but then bails.
I've just run shellcheck on the script and it points out some valid point:
[11:15:44 vagrant@bionic64-vagrant-vm] ~ → shellcheck -s dash install.sh
In install.sh line 22:
raw_version=`curl --silent "https://api.github.com/repos/lukaspustina/wpscan-analyze/releases/latest" | grep tag_name | sed -E 's/.*"v(.*)",/\1/'`
^-- SC2006: Use $(..) instead of legacy `..`.
In install.sh line 28:
old_install=`which wpscan-analyze`
^-- SC2006: Use $(..) instead of legacy `..`.
In install.sh line 29:
old_install_version=`wpscan-analyze --version`
^-- SC2006: Use $(..) instead of legacy `..`.
In install.sh line 52:
git checkout --quiet ${version}
^-- SC2086: Double quote to prevent globbing and word splitting.
In install.sh line 59:
source $HOME/.cargo/env
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.
^-- SC2169: In dash, 'source' in place of '.' is not supported.
^-- SC2086: Double quote to prevent globbing and word splitting.
In install.sh line 135:
chmod +x ${binary_file}
^-- SC2086: Double quote to prevent globbing and word splitting.
Can you please address these.
Last thing: Could you reduce the questions "Change default path" and "Where" to just one question: Set installation path [default: /usr/local/bin]
It steel doesn't work for me the curl -s | bash
Even cat install | bash
doesn't work. It's like it says yes for me and build from source on my Mac...
Does it work for you?
It's not working on a Google cloud shell neither at https://ssh.cloud.google.com/cloudshell
But the other format with sh -c "$()"
works.
The issue seem to be about reading input from user. It seems that doing curl -s | bash
will open a non-interactive shell and that's an issue to read user input.
https://www.tldp.org/LDP/abs/html/intandnonint.html
I see a solution that would be to check wether it's a interactive shell, and if not, re-launch the install script in interactive mode
I see a solution that would be to check wether it's a interactive shell, and if not, re-launch the install script in interactive mode
Not even sure... I've tried the following but not worked
# Test for a terminal!
# As we recall, the -t test option checks whether the stdin, [ -t 0 ],
#+ or stdout, [ -t 1 ], in a given script is running in a terminal.
if [ -t 0 ] # stdin
then
echo "Installing..."
else
echo "Launching..."
sh -c "$(curl -sSL https://raw.githubusercontent.com/tristanlatr/wpscan-analyze/patch-1/install.sh)"
exit 0
fi
## REST of the install script
Hello,
About this install script, do you still want changes to the script ?
I'm not sure i can make it work with curl | sh
...
Right now the script on master doesn't work...
If you don't feel like driving the script forward, I'll probably remove it, because as you say, it doesn't work right now.
Well...
I think this script help greatly the install process, that would be too bad to give up.
Let me try to make it work once last time with curl | sh
.
I'll report back
Should work now !
Using
sh -c "$(curl -sSL https://raw.githubusercontent.com/lukaspustina/wpscan-analyze/master/install.sh)"
to call install script to avoidsh
syntax error and trouble withread
command