-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
38 lines (35 loc) · 878 Bytes
/
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
#!/bin/bash
# tempates tar file with templates
FILE=templates.tar.xz
if [[ -f "$FILE" ]]; then
echo "[+] $FILE exists."
else
echo "[!] $FILE Not found!"
echo "[!] Exiting program!"
exit 0
fi
# templates folder
FOLDER=~/Templates
if [ -d "$FOLDER" ]; then
echo "[+] $FOLDER exists."
else
echo "[!] $FOLDER doesn't exists!"
echo "[+] Creating $FOLDER"
mkdir $FOLDER
echo "[+] Created $FOLDER"
fi
# check if unzip tool exists
PACKAGE=tar
if [ "$(which $PACKAGE)" = '' ]; then
echo "[!] Package doesn't exists!"
echo "[!] Install $PACKAGE package first!"
echo "[*] Command: sudo install $PACKAGE"
echo "[!] Exiting program!"
exit 0
else
echo "[+] Package exists"
# unzip tar file
echo "[+] Extracting templates"
tar -xf $FILE -C $FOLDER --strip-components=1
echo "[+] Program successfully terminated."
fi