-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpos_install.sh
executable file
·121 lines (93 loc) · 2.58 KB
/
pos_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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env bash
# author: Gessé Carneiro Silva ([email protected])
#
#How to use?
# $ chmod +x pos_install.sh
# $ ./pos_install.sh
# ---------- VARIABLES ---------- #
set -e
#Colors
RED='\e[1;91m'
GREEN='\e[1;92m'
NO_COLOR='\e[0m'
#Functions
# -------------------------------TESTS AND REQUIREMENTS----------------------------------------- #
#Updating repository and updating the system
apt_update(){
sudo apt update && sudo apt dist-upgrade -y
}
# Internet working?
internet_tests(){
if ! ping -c 1 8.8.8.8 -q &> /dev/null; then
echo -e "${RED}[ERROR] - Your computer does not have an Internet connection. check the network.${NO_COLOR}"
exit 1
else
echo -e "${GREEN}[INFO] - Internet connection working normally.${NO_COLOR}"
fi
}
# Presentation function
print_ascii_art(){
echo '
_ __ __ __
| | / / ___ / / _____ ____ ____ ___ ___ / /
| | /| / / / _ \ / / / ___/ / __ \ / __ `__ \ / _ \ / /
| |/ |/ / / __/ / / / /__ / /_/ / / / / / / // __/ /_/
|__/|__/ \___/ /_/ \___/ \____/ /_/ /_/ /_/ \___/ (_)
'
}
## Updating the repository
just_apt_update(){
sudo apt update -y
}
##DEB SOFTWARES TO INSTALL
APPS_TO_INSTALL=(
build-essential
audacity
neofetch
guvcview
whois
gnome-tweaks
vlc
qbittorrent
zsh
vim
ffmpeg
tilix
git
wget
gparted
)
install_debs(){
## installing .deb packages downloaded in the previous session ##
echo -e "${VERDE}[INFO] - Installing downloaded .deb packages${NO_COLOR}"
sudo dpkg -i $DOWNLOAD_DIRECTORY/*.deb
# Installing programs in the apt
echo -e "${GREEN}[INFO] - Installing apt packages from the repository${NO_COLOR}"
# Installing app in the apt
for program_name in ${APPS_TO_INSTALL[@]}; do
if ! dpkg -l | grep -q $program_name; then # Only install if not already installed
apt install "$program_name" -y
else
echo "[INSTALLED] - $program_name"
fi
done
}
}
# ----------------------------- POST INSTALL ----------------------------- #
## Finishing, updating and cleaning##
system_clean(){
sudo apt update && sudo apt dist-upgrade -y
flatpak update -y
sudo apt autoclean
sudo apt autoremove -y
}
# ---------------------------------------------------------------------- #
# ---------------------- Execution ----------------------
print_ascii_art
internet_tests
just_apt_update
install_debs
apt_update
system_clean
#Finishing
echo -e "${GREEN}[INFO] - Script finished, install complete!! :)${NO_COLOR}"