forked from ASHWIN990/ADB-Toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·107 lines (67 loc) · 2.86 KB
/
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
#!/bin/bash
echo -e "Argument used '$1'\n"
if [ $(id -u) -ne 0 ]; then
echo -e "\e[1;91mTHE INSTALLATION SCRIPT MUST BE RAN AS ROOT\e[0m"
exit 1
fi
help () {
echo -e "To install ADB-Toolkit use :- \n\e[1;91m sudo bash $0 install \e[92mor \e[1;91msudo bash $0 -i \e[92mor \e[1;91msudo bash $0 -install"
}
opt_install () {
distro=$(awk '/^ID_LIKE=/' /etc/*-release | awk -F'=' '{ print tolower($2) }')
if [ "$distro" == "" ]
then
distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }')
fi
## DEBIAN INSTALLER ##
debian_install () {
apt-get install adb -y
apt-get install fastboot -y
apt-get install ruby-full -y
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod +x msfinstall && ./msfinstall
}
## ARCH INSTALLER ##
arch_install () {
pacman -S --noconfirm android-tools
pacman -S --noconfirm ruby
pacman -S --noconfirm metasploit
}
## CENTOS INSTALLER ##
centos_install () {
yum install -y android-tools
yum install -y ruby
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod +x msfinstall && ./msfinstall
}
## FEDORA INSTALLER ##
fedora_install () {
dnf install -y android-tools
echo -e "\n\n\e[1;91m PLEASE INSTALL THE METASPLOIT FRAMEWORK MANUALLY\n\n"
}
case $distro in
"debian") debian_install;;
"arch") arch_install;;
"centos") centos_install;;
"fedora") fedora_install;;
*) echo -e "THE DISTRO $distro IS NOT IDENTIFIED PLEASE MANUALLY INSTALL 'ADB' & 'FASTBOOT' FOR YOUR DISTRO."; exit 1;;
esac
if [ $? == 0 ]
then
clear
chmod +x ADB-Toolkit.sh
touch ~/.bash_aliases 2> /dev/null
mkdir $PWD/.temp 2> /dev/null
echo "alias adb-toolkit='cd $PWD && sudo bash ADB-Toolkit.sh'" >> ~/.bash_aliases
source ~/.bash_aliases
echo -e "\n\e[1;92mINSTALLATION COMPLETED\n"
echo -e "\e[1;92mUSAGE = \e[1;91m'sudo ./ADB-Toolkit.sh' or you can do 'sudo adb-tookit' from anywhere in shell\e[0m\n\n"
fi
}
if [[ ("$1" = "install" || "$1" = "-i" || "$1" = "-install") ]]
then
opt_install
else
help
fi
#Copyright : ASHWIN990 , ASHWINI SAHU