-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.sh
80 lines (75 loc) · 2.39 KB
/
configure.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
cyan='\e[0;36m'
green='\e[0;32m'
red='\e[1;31m'
Escape="\033";
Reset="${Escape}[0m";
clear
chmod +x rscan
chmod +x src/help
chmod +x src/scan
chmod +x stats/messages
clear
if [ $1 == '-h' ] || [ $1 == '--help' ]; then
echo -e "Usage: ./configure.sh [OPTION]
./configure.sh -h, --help To show this message and exit
./configure.sh -r, --root To use this cfg in sudo mode
./configure.sh -t, --termux To configure this tool in termux android
"
exit 1
fi
if [ $1 == '-r' ] || [ $1 == '--root' ]; then
echo -en $Reset"["; echo -en $green"#"; echo -e $Reset"]" "Starting config script!"
sleep 2
[[ `id -u` -eq 0 ]] > /dev/null 2>&1 || {
echo -en $Reset"["; echo -en $red"!"; echo -en $Reset"]"; echo -en " You must be root to run the script"; echo -e $Reset ; exit 1;
}
{
chmod +x rscan
chmod +x src/help
chmod +x src/scan
chmod +x stats/messages
} || {
echo missing files!
while true; do
read -p "Do you wish to clone repo again (Y/n)" yn
case $yn in
[Yy]* ) cd .. && rm -rf dbuster-pro && git clone "https://github.com/DioBruh/rscnner-pro/"; break;;
[Nn]* ) exit;;
* ) exit 1;;
esac
done
exit 1
}
{ # try
cp -r src/ stats/ /usr/bin/
cp rscan /usr/bin/
chmod +x /usr/bin/rscan
} || { # catch
echo -en $Reset"["; echo -en $red"!"; echo -en $Reset"]"; echo -en " You must be root to run the script"; echo -e $Reset ; exit 1;
}
echo rscan successfully installed, type: "rscan --help"
fi
if [ $1 == ''] || [ $1 == '' ]; then
clear
echo Invalid arguments!
echo -e "Usage: ./configure.sh [OPTION]
./configure.sh -h, --help To show this message and exit
./configure.sh -r, --root To use this cfg in sudo mode
./configure.sh -n, --no-root To use this cfg not in sudo mode
./configure.sh -t, --termux To configure this tool in termux android
"
fi
if [ $1 == '-t' ] || [ $1 == '--termux' ]; then
clear
echo -en $Reset"["; echo -en $green"#"; echo -e $Reset"]" "Starting config script!"
sleep 2
{
cp -r src/ stats/ $HOME/../usr/bin
cp rscan $HOME/../usr/bin
chmod +x $HOME/../usr/bin/rscan
} || { # catch
echo bin/local not found
exit 1
}
echo rscan successfully installed, type: "rscan --help"
fi