blob: 216e59f26c7fa70b167265206e61d6e6fed4eb89 [file] [log] [blame]
Sergio Slobodriancab0a392017-07-13 08:42:10 -04001#!/bin/bash
2
3RESTART_EPOCH=0
4
5
6echo "Staring envoy re-starter"
7
8
9function fork_envoy()
10{
11 echo "Forking envoy"
12 /usr/local/bin/envoy -l debug -c envoy/front-proxy/voltha-grpc-proxy.json --restart-epoch $RESTART_EPOCH &
13 CUR_PID=$!
14 RESTART_EPOCH=`expr $RESTART_EPOCH + 1`
15 wait
16}
17
18function end_envoy()
19{
20 echo "Killing envoy"
21 kill -KILL $CUR_PID
22}
23
24trap fork_envoy SIGHUP
25trap end_envoy SIGTERM
26
27fork_envoy
28
29