Skip to content

Commit 6cdaadf

Browse files
committed
Redmine DSpace#2930: added script for restarting dspace stack if down
1 parent ae673ec commit 6cdaadf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
cd "$(cd "$(dirname "$0")" ; pwd -P )"
4+
date
5+
6+
# Restart DSpace stack if repository is not responding with HTTP 200.
7+
status=`curl -k -o /dev/null -s -w "%{http_code}" https://localhost/repository/xmlui/`
8+
if [[ $status -ne "200" ]]; then
9+
echo "Automatically restarting DSpace stack due to HTTP status $status ..."
10+
./stop_stack.sh
11+
sleep 3
12+
./start_stack.sh
13+
echo "DSpace stack restart complete."
14+
else
15+
echo "No restart needed: HTTP status is $status."
16+
fi
17+
18+
date
19+
echo

0 commit comments

Comments
 (0)