-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup
93 lines (81 loc) · 2.7 KB
/
setup
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
#! /bin/bash
#colors
white="\033[1;37m" ##
grey="\033[0;37m" ##
purple="\033[1;35m" ##
red="\033[1;31m" ##
green="\033[1;32m" ##
yellow="\033[1;33m" ##
purple="\033[0;35m" ##
cyan="\033[0;36m" ##
cyan1="\033[1;36m" ##
cafe="\033[0;33m" ##
fiuscha="\033[0;35m" ##
blue="\033[1;34m" ##
nc="\033[0m" ##
#spinner
spinner() {
pid=$!
spin='\|/-'
i=0
tput civis
while kill -0 $pid 2>/dev/null
do
i=$(( (i+1) %4 ))
printf "\r${cyan1}[${spin:$i:1}]${nc} ${cyan1} $launch"
sleep .1
done
printf "\r ${green}[✔]${nc} ${green} $splashdown";echo
tput cnorm
}
function os () {
cat /etc/os-release > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
GET_DEB=`cat /etc/issue | awk '{print $1}'`
if [ "${GET_DEB}" != "Kali" ];then
OS=DEBIAN
fi
#usr_name=`logname`
BIN="/usr/bin"
main="${HOME}/.BloodyRat"
else
OS=NOT_SUPPORTED
fi
}
function dependencies() {
if [[ `command -v git` && `command -v wget` && `command -v nodejs` && `command -v npm` && `command -v apktool` && `command -v leafpad` ]]; then
dependencies=true
else
pkgs=(git wget nodejs npm apktool leafpad)
for pkg in "${pkgs[@]}"; do
type -p "$pkg" &>/dev/null || {
sudo apt install "$pkg" -y
}
done
fi
}
function git_clone() {
[ -d "${main}" ] && rm -rf ${main} > /dev/null 2>&1
(git clone https://github.com/Bhaviktutorials/BloodyRat --quiet ${main})
}
function do_patches () {
if [ "${OS}" != "DEBIAN" ];then
sudo cat /etc/apt/sources.list > /etc/apt/SL.bk
sudo echo 'deb http://security.debian.org/debian-security stretch/updates main' > /etc/apt/sources.list
sudo apt update -y && sudo apt install openjdk-8-jdk -y
sudo cat /etc/apt/SL.bk > /etc/apt/sources.list
else
sudo apt install openjdk-8-jre-headless -y
fi
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk*/jre/bin/java
sudo apt update -y /dev/null 2&>1
}
function main () {
cd ${main}/server && npm install
sudo su -c "wget -N https://github.com/Bhaviktutorials/BloodyRat/raw/main/files/BloodyRat -q -O ${BIN}/BloodyRat" && sudo su -c "chmod 777 ${BIN}/BloodyRat"
}
os
dependencies
git_clone
do_patches
main