forked from falkenber9/falcon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoop-FalconCaptureProbe.sh
executable file
·61 lines (53 loc) · 1.69 KB
/
Loop-FalconCaptureProbe.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
##
## Copyright (c) 2019 Robert Falkenberg.
##
## This file is part of FALCON
## (see https://github.com/falkenber9/falcon).
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## This program 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 Affero General Public License for more details.
##
## A copy of the GNU Affero General Public License can be found in
## the LICENSE file in the top-level directory of this distribution
## and at http://www.gnu.org/licenses/.
##
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#BUILDDIR="$SCRIPTDIR/../build/src/examples"
LOGDIR="."
INTERVAL_SEC=1
APPLICATION="FalconCaptureProbe"
THE_DATE=`date +"%Y-%m-%d-%H-%M-%S"`
HOSTNAME=`hostname`
APP_STDOUT="$LOGDIR/$THE_DATE-$HOSTNAME-Loop-FalconCaptureProbe.log"
BACKOFF=0
if [ "$HOSTNAME" = "cni-lte5" ]; then
BACKOFF=0
elif [ "$HOSTNAME" = "cni-lte6" ]; then
BACKOFF=1
elif [ "$HOSTNAME" = "cni-lte9" ]; then
BACKOFF=2
else
echo "Unknown hostname in lookup for backoff. Backoff set to $BACKOFF"
fi
APP_PARAMS="-c -b $BACKOFF -N 1"
echo $SCRIPTDIR
#echo $BUILDDIR
#echo $LOGDIR
echo $APPLICATION
echo $APP_PARAMS
while true;
do
THE_DATE=`date +"%Y-%m-%d-%H-%M-%S"`
echo "$THE_DATE-$HOSTNAME" | tee -a $APP_STDOUT
./$APPLICATION $APP_PARAMS 2>&1 | tee -a $APP_STDOUT
echo "Pause for $INTERVAL_SEC s" | tee -a $APP_STDOUT
sleep $INTERVAL_SEC
done;