-
Notifications
You must be signed in to change notification settings - Fork 5
/
install_insync.sh
executable file
·51 lines (35 loc) · 1.54 KB
/
install_insync.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
SCRIPT_NAME=$(basename $BASH_SOURCE)
SCRIPT_LOGFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".log"
SCRIPT_ENVFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".env"
mkdir -p ./logs && chmod 755 ./logs
echo "running "$SCRIPT_NAME
# tested: works on ubuntu 14.04.3 gnome
# tested: works on ubuntu 16.04 gnome
. /etc/lsb-release
echo $DISTRIB_DESCRIPTION
if [ "$DISTRIB_RELEASE" = "14.04" ]; then
echo "running UBUNTU 14.04 version"
if hash insync 2>/dev/null; then
echo " checking insync => ok"
else
echo " checking insync => insync not installed, installing it "
wget -qO - https://d2t3ff60b2tol4.cloudfront.net/[email protected] | sudo apt-key add -
echo "deb http://apt.insynchq.com/ubuntu trusty non-free contrib" | sudo tee -a /etc/apt/sources.list.d/insync.list &>> $SCRIPT_LOGFILE
sudo apt-get -y update &>> $SCRIPT_LOGFILE
sudo apt-get -y install insync &>> $SCRIPT_LOGFILE
fi
elif [ "$DISTRIB_RELEASE" = "16.04" ]; then
echo "running UBUNTU 16.04 version"
if hash insync 2>/dev/null; then
echo " checking insync => ok"
else
echo " checking insync => insync not installed, installing it "
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ACCAF35C
echo "deb http://apt.insynchq.com/ubuntu xenial non-free contrib" | sudo tee -a /etc/apt/sources.list.d/insync.list &>> $SCRIPT_LOGFILE
sudo apt-get -y update &>> $SCRIPT_LOGFILE
sudo apt-get -y install insync &>> $SCRIPT_LOGFILE
fi
else
echo "no compatible installer found for your distribution"
fi