Restructured project by moving files from subfolder to main directory
This commit is contained in:
23
stop.sh
Normal file
23
stop.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Check if Elasticsearch is running
|
||||
if [ -f /app/data/elasticsearch.pid ]; then
|
||||
echo "Stopping Elasticsearch..."
|
||||
PID=$(cat /app/data/elasticsearch.pid)
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
kill "$PID"
|
||||
echo "Waiting for Elasticsearch to stop..."
|
||||
# Wait for process to end
|
||||
while kill -0 "$PID" 2>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
else
|
||||
echo "Elasticsearch process not found, cleaning up PID file."
|
||||
fi
|
||||
rm -f /app/data/elasticsearch.pid
|
||||
else
|
||||
echo "Elasticsearch PID file not found, nothing to stop."
|
||||
fi
|
||||
|
||||
echo "Elasticsearch stopped."
|
||||
Reference in New Issue
Block a user