-
Notifications
You must be signed in to change notification settings - Fork 0
/
open_ndpiReader
executable file
·42 lines (40 loc) · 995 Bytes
/
open_ndpiReader
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
37
38
39
40
41
#! /bin/bash
App=/usr/src/ndpi-netfilter/nDPI/example
cd $App
while :
do
case $1 in
start)
#print PID num
echo " "
echo " "
echo "#########################"
echo "PID Num= $$" >> /tmp/result.txt
echo `date` >> /tmp/result.txt
./ndpiReader -i eth0 -s 10&
sleep 30s
continue
;;
stop)
#print PID num
echo " "
echo " stop the PID "
echo "#########################"
echo "PID Num= $$" >> /tmp/result.txt
echo `date` >> /tmp/result.txt
Pid=$(ps -ef|grep 'ndpiReader'|awk '{print $2}')
echo "$Pid will be killed" >> /tmp/result.txt
kill -9 $Pid
break
;;
restart|force-reload)
echo "restart|force-reload will be killed" >> /tmp/result.txt
;;
status)
echo "status will be killed" >> /tmp/result.txt
;;
*)
echo "status2 will be killed" >> /tmp/result.txt
;;
esac
done