-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·57 lines (39 loc) · 1.17 KB
/
install.sh
File metadata and controls
executable file
·57 lines (39 loc) · 1.17 KB
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
#!/bin/bash
#this install script will clone exploit-db official repository on ./exploits
#it will run `php update-db.php` command to sinchronize files with db
git=$(which git);
php=$(which php);
exploit_dir=./exploits;
gitremote="https://github.com/offensive-security/exploit-database.git"
function install()
{
## creating or going to correct folder
mkdir -p "$exploit_dir/"
cd "$exploit_dir/"
## parsing
if [[ "$( ${git} rev-parse --is-inside-work-tree )" != "true" ]]; then
if [[ "$( ls )" = "" ]]; then
# nothing here clonning
echo -e '\nGood ! nothing here ! Clonning Exploit-db Repository .....\n';
${git} clone "${gitremote}" .
fi
fi
# ok adding
if [[ "$( ${git} remote -v )" != *"${gitremote}"* ]]; then
echo 'adding remote repo' "${gitremote}"
git init >/dev/null
git remote add origin "${gitremote}" 2>/dev/null
fi
# Make sure to prep checkout first
git checkout -- .
# Update from git
git pull origin master
# If conflicts, clean and try again
if [[ "$?" -ne 0 ]]; then
git clean -d -fx ""
git pull origin master
fi
echo -e "Ok ! all installed"
exit 6
}
install;