File tree 1 file changed +15
-14
lines changed
1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,18 @@ handle_int() {
17
17
trap handle_term SIGTERM
18
18
trap handle_int SIGINT
19
19
20
- # start change script and our server
21
- echo ' starting process...'
22
- " $@ " &
23
- child=$!
24
- sleep 10
25
- echo " killing pid $child ..."
26
- kill -9 " $child "
27
- while kill -0 " $child " 2> /dev/null; do # wait for child to exit (kill -0 is falsy if pid is gone)
28
- sleep 1
29
- done
30
- echo ' killed...'
31
- sleep 5
32
- echo ' restarting process...'
33
- " $@ "
20
+ while [ " $killed " -eq 0 ]; # stop looping if we were interrupted
21
+ do
22
+ # start change script and our server
23
+ echo ' starting process...'
24
+ " $@ " &
25
+ child=$!
26
+ sleep 20
27
+ echo " killing pid $child ..."
28
+ kill -9 " $child "
29
+ while kill -0 " $child " 2> /dev/null; do # wait for child to exit (kill -0 is falsy if pid is gone)
30
+ sleep 1
31
+ done
32
+ echo ' killed...'
33
+ sleep 5
34
+ done
You can’t perform that action at this time.
0 commit comments