generated from GDGVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathinstall.sh
102 lines (80 loc) · 3.21 KB
/
install.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
. /etc/os-release
if [ -z "$ID_LIKE" ]; then
OS=$ID
else
OS=$ID_LIKE
fi
FONTS_FILE=https://github.com/GDGVIT/HandWriter/raw/master/assets/roboto.zip
if [ "$OS" = "arch" ]
then
echo "Installing the HandWriter package"
curl -O https://fbs.sh/DSC-VIT/HandWriter/public-key.gpg && sudo pacman-key --add public-key.gpg && sudo pacman-key --lsign-key B3462FDA0DF0DB4C20B79E73CADD865FF9A9F9BA && rm public-key.gpg
echo -e '\n[HandWriter]\nServer = https://fbs.sh/DSC-VIT/HandWriter/arch' | sudo tee -a /etc/pacman.conf
sudo pacman -Syu handwriter
echo "Installing fonts"
curl $FONTS_FILE -o ~/roboto.zip -L
unzip ~/roboto.zip -d ~/roboto-font
mkdir ~/.local/share/fonts
cp ~/roboto-font/* ~/.local/share/fonts/
echo "Cleaning up"
rm ~/roboto.zip && rm -r ~/roboto-font
echo "Adding HandWriter to PATH"
cd /usr/local/bin
sudo ln -s /opt/HandWriter/HandWriter
elif [ "$OS" = "fedora" ]
then
echo "Installing the HandWriter package"
sudo rpm -v --import https://fbs.sh/DSC-VIT/HandWriter/public-key.gpg
sudo dnf config-manager --add-repo https://fbs.sh/DSC-VIT/HandWriter/rpm/HandWriter.repo
yes | sudo dnf install handwriter
echo "Installing fonts"
wget $FONTS_FILE -O ~/roboto.zip
unzip ~/roboto.zip -d ~/roboto-font
mkdir ~/.local/share/fonts
cp ~/roboto-font/* ~/.local/share/fonts/
echo "Cleaning up"
rm ~/roboto.zip && rm -r ~/roboto-font
echo "Adding HandWriter to PATH"
cd /usr/local/bin
sudo ln -s /opt/HandWriter/HandWriter
elif [ "$OS" = "rhel fedora" ]
then
echo "Installing the HandWriter package"
sudo rpm -v --import https://fbs.sh/DSC-VIT/HandWriter/public-key.gpg
sudo yum-config-manager --add-repo https://fbs.sh/DSC-VIT/HandWriter/rpm/HandWriter.repo
yes | sudo yum install handwriter
echo "Installing fonts"
wget $FONTS_FILE -O ~/roboto.zip
unzip ~/roboto.zip -d ~/roboto-font
mkdir ~/.local/share/fonts
cp ~/roboto-font/* ~/.local/share/fonts/
echo "Cleaning up"
rm ~/roboto.zip && rm -r ~/roboto-font
echo "Adding HandWriter to PATH"
cd /usr/local/bin
sudo ln -s /opt/HandWriter/HandWriter
elif [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] || [ "$OS" = "ubuntu debian" ]
then
echo "Installing the HandWriter package"
sudo apt-get install apt-transport-https
wget -qO - https://fbs.sh/DSC-VIT/HandWriter/public-key.gpg | sudo apt-key add -
echo 'deb [arch=amd64] https://fbs.sh/DSC-VIT/HandWriter/deb stable main' | sudo tee /etc/apt/sources.list.d/handwriter.list
sudo dpkg-divert --local --divert /opt/HandWriter/libz.so.1.old --rename /opt/HandWriter/libz.so.1
sudo apt-get update
yes | sudo apt-get install handwriter
echo "Creating symlink"
cd /opt/HandWriter/
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1
cd
echo "Installing fonts"
wget $FONTS_FILE -O ~/roboto.zip
unzip ~/roboto.zip -d ~/roboto-font
mkdir ~/.local/share/fonts
cp ~/roboto-font/* ~/.local/share/fonts/
echo "Cleaning up"
rm ~/roboto.zip && rm -r ~/roboto-font
echo "Adding HandWriter to PATH"
cd /usr/local/bin
sudo ln -s /opt/HandWriter/HandWriter
fi