-
Notifications
You must be signed in to change notification settings - Fork 2
/
install-all.sh
68 lines (58 loc) · 2.37 KB
/
install-all.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
#!/bin/bash
# Script d'installation de mes scripts getip et sping avec alias.
# Par Mickael Asseline (PAPAMICA)
# Compatibles avec toutes les distributions
# Compatible avec Bash et Zsh
echo ""
tput setaf 2; echo "Installation of dependencies"
tput setaf 7; echo ""
packagesNeeded='speedtest network-manager net-tools'
if [ -x "$(command -v apk)" ]; then
sudo apk add -y --no-cache $packagesNeeded
tput setaf 2; echo "$packagesNeeded installed."
elif [ -x "$(command -v apt-get)" ]; then
sudo apt-get remove speedtest-cli
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install -y $packagesNeeded
tput setaf 2; echo "$packagesNeeded installed."
elif [ -x "$(command -v dnf)" ]; then
sudo dnf remove speedtest-cli
curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash
sudo dnf install -y $packagesNeeded
tput setaf 2; echo "$packagesNeeded installed."
elif [ -x "$(command -v zypper)" ]; then
sudo zypper install -y $packagesNeeded
tput setaf 2; echo "$packagesNeeded installed."
elif [ -x "$(command -v pacman)" ]; then
tput setaf 1; echo "FAILED TO INSTALL PACKAGE: Package manager not found. You must manually install: $packagesNeeded">&2;
else
tput setaf 1; echo "FAILED TO INSTALL PACKAGE: Package manager not found. You must manually install: $packagesNeeded">&2;
fi
$DESKTOP_SESSION
tput setaf 7; echo ""
# Copie des scripts dans le dossier utilisateur
cp getip.sh ~/.getip.sh
chmod +x ~/.getip.sh
cp sping.sh ~/.getip-plugin.sh
chmod +x ~/.getip-plugin.sh
cp -r getip-img/ ~/.getip-img/
cp sping.sh ~/.sping.sh
chmod +x ~/.sping.sh
echo ""
tput setaf 2; echo "Current User : $USER"
tput setaf 2; echo "Current Shell : $SHELL"
tput setaf 2; echo "Current Desktop Session : $DESKTOP_SESSION"
tput setaf 7; echo ""
if [[ $SHELL =~ "zsh" ]]; then
echo "alias getip=\"~/.getip.sh\"" >> ~/.zshrc
echo "alias sping=\"~/.sping.sh\"" >> ~/.zshrc
else
echo "alias getip=\"~/.getip.sh\"" >> ~/.bashrc
echo "alias sping=\"~/.sping.sh\"" >> ~/.bashrc
fi
tput setaf 2; echo ""
tput setaf 2; echo "Installation complete"
tput setaf 2; echo "Installation complete"
tput setaf 2; echo "After reconnect, you can use this commands : "
tput setaf 2; echo " - getip"
tput setaf 2; echo " - sping"