Fix
[ryzomcore.git] / ryzom / server / tools / wait_and_notify.sh
blob40800d0c1846e6620bc50eae180f833d27d7c93b
1 #!/bin/bash
2 # ______ _____ _ _ _____ _
3 # | ___ \ / ___| | | | |_ _| | |
4 # | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___
5 # | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __|
6 # | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \
7 # \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/
8 # __/ |
9 # |___/
11 # Ryzom - MMORPG Framework <https://ryzom.com/dev/>
12 # Copyright (C) 2019 Winch Gate Property Limited
13 # This program is free software: read https://ryzom.com/dev/copying.html for more details
15 # This script will notify external services like RocketChat or Web Apps
18 CWD=$(dirname "$0")
19 LOGFILE=$1
20 STRING=$2
21 NAME=$3
22 SLEEP=$4
24 $CWD/notify.sh ServiceStarting $NAME
25 mkdir -p $SHARD_PATH/states/
26 sleep $SLEEP
27 grep -m 1 "$STRING" <( exec tail -f $LOGFILE )
29 echo "notifying $CWD/notify.sh ServiceStarted $NAME"
30 $CWD/notify.sh ServiceStarted $NAME