Removed useless code of deprecated make command.
[src/xds/xds-server.git] / scripts / xds-utils / xds-server-stop.sh
1 #!/bin/bash
2  ###########################################################################
3 # Copyright 2017 IoT.bzh
4 #
5 # author: Sebastien Douheret <sebastien@iot.bzh>
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
19
20 # Stop it gracefully
21 pkill -INT xds-server
22 sleep 1
23
24 # Seems no stopped, nasty kill
25 nbProc=$(ps -ef |grep xds-server |grep -v grep |wc -l)
26 if [ "$nbProc" != "0" ]; then
27     pkill -KILL xds-server
28 fi
29
30 nbProc=$(ps -ef |grep syncthing |grep -v grep |wc -l)
31 if [ "$nbProc" != "0" ]; then
32     pkill -KILL syncthing
33     pkill -KILL syncthing-inotify
34 fi
35
36 exit 0