Skip to content

Commit 5e5aa78

Browse files
committed
Merge pull request #28 from u-s-p/feature-deploy-script
Remove existing symlinks to logstash-modsecurity
2 parents e2d070b + d9162fb commit 5e5aa78

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)