Looking for syncthing version now put it into a variable
This commit is contained in:
parent
308fbeb2db
commit
014b97ddea
@ -10,7 +10,7 @@ sudo apt install net-tools
|
||||
ip=$(sudo ifconfig eth0 | perl -ne 'print $1 if /inet\s.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b/')
|
||||
|
||||
echo "Please enter Syncthing Version required"
|
||||
read syncthingversion
|
||||
syncthingversion=$(curl --silent "https://api.github.com/repos/syncthing/syncthing/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
|
||||
# Setup Syncthing User
|
||||
adduser \
|
||||
@ -34,7 +34,7 @@ mkdir /opt/syncthing/bin/current
|
||||
|
||||
# Get Syncthing and setup
|
||||
cd /opt/syncthing/bin
|
||||
wget https://github.com/syncthing/syncthing/releases/download/$(curl --silent "https://api.github.com/repos/syncthing/syncthing/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')/syncthing-linux-amd64-$(curl --silent "https://api.github.com/repos/syncthing/syncthing/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/').tar.gz
|
||||
wget https://github.com/syncthing/syncthing/releases/download/$(echo $syncthingversion)/syncthing-linux-amd64-$(echo $syncthingversion).tar.gz
|
||||
untar syncthing-linux-amd64-v$syncthingversion.tar.gz
|
||||
cp -r syncthing-linux-amd64-v$syncthingversion/* /opt/syncthing/bin/current
|
||||
sudo ln -f /opt/syncthing/bin/current/syncthing /usr/local/bin/syncthing
|
||||
|
||||
Loading…
Reference in New Issue
Block a user