zerotier / install.zerotier.com

Source for https://install.zerotier.com curl|bash installer
https://install.zerotier.com
BSD 3-Clause "New" or "Revised" License
65 stars 47 forks source link

Linux Mint - One-Line Installer (curl -s https://install.zerotier.com | sudo bash) fails on non integer version number (FIX INCLUDED) #101

Open raimocom opened 3 weeks ago

raimocom commented 3 weeks ago

The installer fails on installations with a non integer version number (eg. 21.3)

The key error lines are:

main: line 252: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")
main: line 254: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")
bash: line 306: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")

Full script output:

user@mint-desktop:~$ curl -s https://install.zerotier.com | sudo bash

*** ZeroTier Service Quick Install for Unix-like Systems

*** Tested OSes / distributions:

***   MacOS (10.13+) (just installs ZeroTier One.pkg)
***   Debian Linux (7+)
***   RedHat/CentOS Linux (6+)
***   Fedora Linux (16+)
***   SuSE Linux (12+)
***   Mint Linux (20+)
***   Kali Linux (2024.1+)

*** Supported architectures vary by OS / distribution. We try to support
*** every system architecture supported by the target.

*** Please report problems by opening a GitHub issue or Pull Request at: 
*** https://github.com/zerotier/install.zerotier.com
*** Please include the content of `/etc/os-release` for your distribution.

*** Detecting Linux Distribution

*** Detected Linux Mint, creating /etc/apt/sources.list.d/zerotier.list
bash: line 306: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")
Hit:1 http://ftp5.gwdg.de/pub/linux/debian/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                                                                                                                             
Hit:3 http://ftp5.gwdg.de/pub/linux/debian/ubuntu jammy-updates InRelease                                                                                                                                                                    
Hit:4 http://ftp5.gwdg.de/pub/linux/debian/ubuntu jammy-backports InRelease                                                                                                                                                                  
Get:5 https://download.docker.com/linux/debian bookworm InRelease [43.3 kB]                                                                                                                                                                  
Ign:6 https://ftp-stud.hs-esslingen.de/pub/Mirrors/packages.linuxmint.com virginia InRelease                                                                                                                          
Hit:7 https://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                                                         
Hit:8 https://ppa.launchpadcontent.net/nm-l2tp/network-manager-l2tp/ubuntu jammy InRelease                                                                                                      
Hit:9 https://ftp-stud.hs-esslingen.de/pub/Mirrors/packages.linuxmint.com virginia Release                                                                    
Hit:10 https://www.kismetwireless.net/repos/apt/release/jammy jammy InRelease                                                           
Hit:11 https://download.sublimetext.com apt/stable/ InRelease
Fetched 43.3 kB in 1s (55.5 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gpg is already the newest version (2.2.27-3ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
main: line 252: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")
main: line 254: [[: 21.3: syntax error: invalid arithmetic operator (error token is ".3")
Unsupported distribution linuxmint 21.3

proposed working fix (patched version zerotier_installer.sh.txt):

VERSION_ID=$(echo $VERSION_ID | cut -d . -f 1)

I could not find the installer script in the repo. Therefore no pull request.

glimberg commented 3 weeks ago

install script is here: https://github.com/zerotier/install.zerotier.com/blob/main/install.sh.in

raimocom commented 3 weeks ago

Here you go :smile:

https://github.com/zerotier/install.zerotier.com/pull/102