nigiri icon indicating copy to clipboard operation
nigiri copied to clipboard

install.sh issues on machine without docker installed

Open philippem opened this issue 2 years ago • 2 comments

3 issues that came up when running

curl https://getnigiri.vulpem.com | bash

on an Ubuntu 22.04.1 VM that does not yet have docker installed.

  1. the script doesn't exit when docker is not found:
$ curl https://getnigiri.vulpem.com | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3215  100  3215    0     0   9345      0 --:--:-- --:--:-- --:--:--  9345
Fetching https://github.com/vulpemventures/nigiri/releases/latest...
Latest release tag = v0.4.1
Fetching https://github.com/vulpemventures/nigiri/releases/download/v0.4.1/nigiri-linux-amd64...
Moving binary to /usr/local/bin...
Setting binary permissions...
Checking for Docker and Docker compose...
Warning: Nigiri uses Docker and it seems not to be installed, check the official documentation for downloading it.
bash: line 119: [ linux: command not found
https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/

🍣 Nigiri Bitcoin installed!
$ 

The script should probably exit immediately.

  1. The test at line 119 reports an error (see above) that may be due to the previous test using == instead of =

  2. /usr/local/bin/nigiri is created even though docker is not installed, leading to a "half install":

$ curl https://getnigiri.vulpem.com | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3215  100  3215    0     0   9352      0 --:--:-- --:--:-- --:--:--  9345
Nigiri is already installed and will be deleted.

Info: when uninstalling an old Nigiri version Docker must be running.

Be sure to start the Docker daemon before launching this installation script.

Stopping Nigiri...
Removing Nigiri...
Removing local images...
main: line 28: docker: command not found
main: line 28: docker: command not found
main: line 28: docker: command not found

...

The script should probably check for pre-reqs (docker installed) before making any changes to the local FS.

philippem avatar Aug 22 '22 23:08 philippem