-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-eggs.sh
executable file
·54 lines (41 loc) · 1.23 KB
/
get-eggs.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
#!/bin/bash -e
# Controllo se l'utente è root
if [ "$EUID" -ne 0 ]; then
echo ">> This script must be run as root. Please use sudo or log in as root and try again."
exit 1
fi
# Carica le variabili dal file /etc/os-release
source /etc/os-release
# Funzione per verificare se una stringa è contenuta in un'altra
contains() {
[[ "$1" == *"$2"* ]]
}
# Controlla il valore di ID e ID_LIKE
if [ "$ID" = "alpine" ] || [ "$ID_LIKE" = "alpine" ]; then
source ./alpine.sh
elif [ "$ID" = "arch" ] ||
contains "$ID_LIKE" "arch"; then
source ./aur.sh
elif [ "$ID" = "debian" ] ||
[ "$ID" = "ubuntu" ] ||
[ "$ID" = "linuxmint" ] ||
contains "$ID_LIKE" "debian" ||
contains "$ID_LIKE" "ubuntu"; then
source ./debs.sh
elif [ "$ID" = "fedora" ] ||
contains "$ID_LIKE" "fedora" ||
contains "$ID_LIKE" "rhel" ||
contains "$ID_LIKE" "centos"; then
source ./tarballs.sh
elif [ "$ID" = "manjaro" ] ||
[ "$ID" = "biglinux" ] ||
[ "$ID" = "bigcommunity" ]; then
source ./manjaro.sh
fi
# Gestione di ID_LIKE non impostato o casi specifici
if [ "$ID" = "artix" ] ||
[ "$ID" = "blendos" ] ||
[ "$ID" = "blackarch" ] ||
[ "$ID" = "crystal" ]; then
source ./aur.sh
fi