-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckpointer-actions.sh
More file actions
executable file
·36 lines (33 loc) · 1.06 KB
/
Copy pathcheckpointer-actions.sh
File metadata and controls
executable file
·36 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Copyright (C) 2024, 2025, Yasumasa Suenaga
#
# This file is part of checkpointer
#
# checkpointer is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# checkpointer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with checkpointer. If not, see <http://www.gnu.org/licenses/>.
CHECKPOINTER_HOST=localhost:10095
CMD=''
case "$CRTOOLS_SCRIPT_ACTION" in
'pre-dump')
CMD='before-checkpoint';;
'post-resume')
CMD='after-restore';;
esac
if [ -n "$CMD" ]; then
RESULT=`curl -XPOST -s -w "%{http_code}" http://$CHECKPOINTER_HOST/$CMD`
if [ $RESULT -eq 204 ]; then
exit 0
else
exit 1
fi
fi