mirror of
https://github.com/YunoHost-Apps/syncthing_ynh.git
synced 2024-09-03 20:26:23 +02:00
switch installation to official repository
This commit is contained in:
parent
1cab872562
commit
7cec8137d5
1 changed files with 8 additions and 17 deletions
|
@ -3,6 +3,9 @@
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$1
|
domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
|
# channel: release or devel. will add choise on install
|
||||||
|
syncChannel=release
|
||||||
|
|
||||||
|
|
||||||
# Configurable variables
|
# Configurable variables
|
||||||
syncVersion="0.11.5"
|
syncVersion="0.11.5"
|
||||||
|
@ -11,18 +14,6 @@ syncUser=debian-syncthing
|
||||||
syncSyncport=22000
|
syncSyncport=22000
|
||||||
syncUIport=8384
|
syncUIport=8384
|
||||||
|
|
||||||
arch=`uname -m`
|
|
||||||
if [ "$arch" = "x86_64" ] ; then
|
|
||||||
syncArch="amd64"
|
|
||||||
fi
|
|
||||||
if [ "$arch" = "i386" ] || [ "$arch" == "i686" ] ; then
|
|
||||||
syncArch="386"
|
|
||||||
fi
|
|
||||||
if [ "$arch" = "arm" ] ; then
|
|
||||||
syncArch="arm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
sudo yunohost app checkurl $domain$path -a syncthing
|
sudo yunohost app checkurl $domain$path -a syncthing
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
echo $domain$path is not available. Please choose another url for Syncthing.
|
echo $domain$path is not available. Please choose another url for Syncthing.
|
||||||
|
@ -57,11 +48,11 @@ sudo find $syncHome/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done
|
||||||
sudo find $syncHome/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done
|
sudo find $syncHome/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done
|
||||||
|
|
||||||
# Download and install syncthing binary
|
# Download and install syncthing binary
|
||||||
sudo wget https://github.com/syncthing/syncthing/releases/download/v$syncVersion/syncthing-linux-$syncArch-v$syncVersion.tar.gz -O /tmp/syncthing.tar.gz
|
sudo apt-get install curl
|
||||||
sudo tar -C /tmp -xvf /tmp/syncthing.tar.gz syncthing-linux-$syncArch-v$syncVersion/syncthing
|
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
|
||||||
sudo mv /tmp/syncthing-linux-$syncArch-v$syncVersion/syncthing $syncHome/bin/syncthing
|
echo "deb http://apt.syncthing.net/ syncthing $syncChannel" | sudo tee /etc/apt/sources.list.d/syncthing-$syncChannel.list
|
||||||
sudo chown $syncUser: $syncHome/bin/syncthing
|
sudo apt-get update
|
||||||
sudo chmod 750 $syncHome/bin/syncthing
|
sudo apt-get install syncthing
|
||||||
|
|
||||||
# Install and monitor service
|
# Install and monitor service
|
||||||
sudo cp ../conf/syncthing /etc/init.d/syncthing
|
sudo cp ../conf/syncthing /etc/init.d/syncthing
|
||||||
|
|
Loading…
Add table
Reference in a new issue