blob: d4b9b56bb3267247f7268ef98db8ba1bb0f98684 [file] [log] [blame]
Dean Troyer3159a822014-08-27 14:13:58 -05001#!/bin/bash
2# fake-service.sh - a fake service for start/stop testing
3# $1 - sleep time
4
5SLEEP_TIME=${1:-3}
6
7LOG=/tmp/fake-service.log
8TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
9
10# duplicate output
11exec 1> >(tee -a ${LOG})
12
13echo ""
14echo "Starting fake-service for ${SLEEP_TIME}"
15while true; do
16 echo "$(date +${TIMESTAMP_FORMAT}) [$$]"
17 sleep ${SLEEP_TIME}
18done
19