Skip to content

Commit 160896c

Browse files
committed
fix: make remaining git clone operations idempotent in install.sh
Apply clone-or-update logic to prevent script crashes when directories already exist: - radamsa: Check if directory exists, pull if present, clone if not - Sublist3r: Check if directory exists, pull if present, clone if not - enum4linux-ng: Use existing clone_or_update helper function - exploitdb (Parrot): Check if /opt/exploitdb exists before cloning This allows the install script to be safely re-run without errors.
1 parent 39b1141 commit 160896c

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

install.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,14 @@ docker-compose -f docker-compose.yml up -d
158158
#--------------------------------------------------
159159
echo "[+] Installing radamsa..."
160160
cd /root
161-
git clone https://gitlab.com/akihe/radamsa.git
162-
cd radamsa
161+
if [ -d "radamsa" ]; then
162+
echo "[*] Directory 'radamsa' already exists. Pulling latest changes..."
163+
cd radamsa && git pull
164+
else
165+
echo "[+] Cloning radamsa..."
166+
git clone https://gitlab.com/akihe/radamsa.git
167+
cd radamsa
168+
fi
163169
make && make install
164170

165171
#--------------------------------------------------
@@ -168,8 +174,14 @@ make && make install
168174
#--------------------------------------------------
169175
echo "[+] Installing Sublist3r in the same Python venv..."
170176
cd /root
171-
git clone https://github.com/aboul3la/Sublist3r.git
172-
cd Sublist3r
177+
if [ -d "Sublist3r" ]; then
178+
echo "[*] Directory 'Sublist3r' already exists. Pulling latest changes..."
179+
cd Sublist3r && git pull
180+
else
181+
echo "[+] Cloning Sublist3r..."
182+
git clone https://github.com/aboul3la/Sublist3r.git
183+
cd Sublist3r
184+
fi
173185

174186
# Reactivate the venv
175187
source "$VENV_DIR/bin/activate"
@@ -180,7 +192,7 @@ deactivate
180192
# 10) Install enum4linux-ng
181193
#--------------------------------------------------
182194
cd /root
183-
git clone https://github.com/cddmp/enum4linux-ng
195+
clone_or_update https://github.com/cddmp/enum4linux-ng.git
184196
# You can also pip-install it in the venv if you want
185197

186198
#--------------------------------------------------
@@ -189,7 +201,13 @@ git clone https://github.com/cddmp/enum4linux-ng
189201
distribution=$(lsb_release -i | awk '{print $NF}')
190202
if [[ "$distribution" == "Parrot" ]]; then
191203
echo "[+] Installing searchsploit for Parrot..."
192-
git clone https://github.com/offensive-security/exploitdb.git /opt/exploitdb
204+
if [ -d "/opt/exploitdb" ]; then
205+
echo "[*] Directory '/opt/exploitdb' already exists. Pulling latest changes..."
206+
cd /opt/exploitdb && git pull
207+
else
208+
echo "[+] Cloning exploitdb..."
209+
git clone https://github.com/offensive-security/exploitdb.git /opt/exploitdb
210+
fi
193211
ln -sf /opt/exploitdb/searchsploit /usr/local/bin/searchsploit
194212
fi
195213

0 commit comments

Comments
 (0)