-
Notifications
You must be signed in to change notification settings - Fork 8
/
packages.sh
63 lines (48 loc) · 1.94 KB
/
packages.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
#!/bin/bash
#
# Copyright (c) 2022 Barchampas Gerasimos <[email protected]>.
# wifi agent is a rogue access point.
#
# wifi agent is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wifi agent is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Terminal Colors
RED="$(printf '\033[31m')"
GREEN="$(printf '\033[32m')"
ORANGE="$(printf '\033[33m')"
BLUE="$(printf '\033[34m')"
MAGENTA="$(printf '\033[35m')"
CYAN="$(printf '\033[36m')"
WHITE="$(printf '\033[37m')"
BLACK="$(printf '\033[30m')"
#install packages
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Installing required packages..."
if [[ `command -v figlet` && `command -v hostapd` && `command -v dnsmasq` ]]; then
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} Wifi Agent packages already installed."
sleep 1
else
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Installing package : ${CYAN}$pkg${MAGENTA}"${WHITE}
if [[ `command -v apt` ]]; then
apt install figlet hostapd dnsmasq -y
elif [[ `command -v apt-get` ]]; then
apt-get install figlet hostapd dnsmasq -y
elif [[ `command -v pacman` ]]; then
sudo pacman -S figlet hostapd dnsmasq --noconfirm
elif [[ `command -v dnf` ]]; then
sudo dnf -y install figlet hostapd dnsmasq
else
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Unsupported package manager, Install packages manually."
{ sleep 2; exit 1; }
fi
fi