-
Notifications
You must be signed in to change notification settings - Fork 1
/
backup.sh
69 lines (57 loc) · 1.81 KB
/
backup.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
#!/bin/bash
# Backup file
bold=$(tput bold)
normal=$(tput sgr0)
echo "${bold}--------------------------------"
echo "| |"
echo "| Linux Fonts Installer |"
echo "| https://github.com/ujaRHR |"
echo "| |"
echo "--------------------------------${normal}"
echo ""
echo "Checking if all tools are installed..."
# Check if wget installed, if not, then install
if ! command -v wget &> /dev/null
then
echo "wget not found, installing wget..."
# If package manager is apt, then install wget using apt
if ! command -v apt &> /dev/null
then
sudo yum -y install wget
echo "✓ Successfully installed wget!"
# If package manager is yum, then install wget using yum
elif ! command -v yum &> /dev/null
then
sudo apt install wget -y
echo "✓ Successfully installed wget!"
fi
else
echo "✓ Already Installed. Woah!"
fi
fetchFonts="https://raw.githubusercontent.com/ujarhr/linux-font-installer/main/root/fonts.tar.xz"
fontsDir="/home/$USER/.fonts"
# Check if the directory exists, if not, then create it.
if [ ! -d "$fontsDir" ]; then
mkdir -p $fontsDir;
else
echo "✓ Fonts Directory exists. Superb!"
fi
echo -e "↻ Downloading file...\n"
cd $fontsDir;
/usr/bin/wget -q --show-progress $fetchFonts
# Check if the file exists and extract it
cd $fontsDir"/"
if [ -f fonts.tar.xz ];
then
echo -e "↻ Installing !\n";
tar -xf fonts.tar.xz;
rm fonts.tar.xz;
else
echo -e "✗ Something went wrong! Try again...✗\n";
exit;
fi
echo -e "\n✓ ${bold}Download and Installation Complete !!!"
echo -e "✓ Please restart your computer to see the changes.\n"
echo -e "❤ ${normal}Thank you for using Linux Fonts Installer!"
echo -e "❤ Created by Reajul Hasan Raju"
echo -e "❤ https://github.com/ujaRHR"