Fixed synthing script to remove excess files when finished, and added current version.txt in bin dir for when update function is added
This commit is contained in:
parent
014b97ddea
commit
34ea2e9584
@ -8,10 +8,9 @@ sudo apt install net-tools
|
||||
|
||||
# Set Variables
|
||||
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"
|
||||
syncthingversion=$(curl --silent "https://api.github.com/repos/syncthing/syncthing/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
|
||||
|
||||
# Setup Syncthing User
|
||||
adduser \
|
||||
--system \
|
||||
@ -35,9 +34,13 @@ mkdir /opt/syncthing/bin/current
|
||||
# Get Syncthing and setup
|
||||
cd /opt/syncthing/bin
|
||||
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
|
||||
untar syncthing-linux-amd64-$syncthingversion.tar.gz
|
||||
cp -r syncthing-linux-amd64-$syncthingversion/* /opt/syncthing/bin/current
|
||||
cat <<EOF > /opt/syncthing/bin/version.txt
|
||||
$syncthingversion
|
||||
EOF
|
||||
rm syncthing-linux-amd64-$syncthingversion.tar.gz
|
||||
rm -r syncthing-linux-amd64-$(echo $syncthingversion)
|
||||
|
||||
# Setup Supervisor
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user