summaryrefslogtreecommitdiffstats
path: root/tests/testsuites/omprog-single-instance-bin.sh
blob: bde73da67a8c15a8faefc486eaf55f3dea84c5a4 (plain)
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
#!/bin/bash

outfile=$RSYSLOG_OUT_LOG

# This line should appear only once in the output file for the test to pass:
echo "Starting" >> $outfile

# Write also to stderr (useful for testing the 'output' setting)
>&2 echo "[stderr] Starting"

echo "OK"

read line
while [[ -n "$line" ]]; do
    echo "Received $line" >> $outfile
    >&2 echo "[stderr] Received $line"
    echo "OK"
    read line
done

# This line should appear only once in the output file for the test to pass:
echo "Terminating" >> $outfile
>&2 echo "[stderr] Terminating"

exit 0