Skip to content

Commit d9162fb

Browse files
author
Lucas Bremgartner
committed
Remove existing symlinks to logstash-modsecurity
1 parent 6b3c7d0 commit d9162fb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,21 @@ echo "TARGET: ${TARGET}"
157157
echo "SOURCEDIR: ${SOURCEDIR}"
158158
echo
159159

160+
# Remove existing symlinks
161+
if [[ "$MODE" == "symlink" ]]; then
162+
for LINK in `find ${TARGET} -type l`; do
163+
LINKTARGET=$(readlink ${LINK} | grep ${SOURCEDIR})
164+
if [[ -n "${LINKTARGET}" ]]; then
165+
echo "remove existing link: ${LINK}"
166+
rm ${LINK}
167+
if [[ "$?" -ne "0" ]]; then
168+
echo "ERROR: Unable to remove existing symlink ${LINK}"
169+
fi
170+
fi
171+
done
172+
fi
173+
174+
# Create logstash config
160175
for FILE in "${MODULES[@]}"
161176
do
162177
echo "process ${FILE}"

0 commit comments

Comments
 (0)