2 # ______ _____ _ _ _____ _
3 # | ___ \ / ___| | | | |_ _| | |
4 # | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___
5 # | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __|
6 # | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \
7 # \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/
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
24 if [[ "$COMMAND" == "ServiceStarted" ]]
26 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
28 echo "Nofitiy $(hostname -s):$2 started"
29 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=started&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY&service=$2" & 2> /dev
/null
30 echo $COMMAND > $SHARD_PATH/states
/$2.txt
32 elif [[ "$COMMAND" == "ServiceStarting" ]]
34 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
36 echo "Nofitiy $(hostname -s):$2 starting"
37 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=starting&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY&service=$2" & 2> /dev
/null
38 echo $COMMAND > $SHARD_PATH/states
/$2.txt
40 elif [[ "$COMMAND" == "ServiceStopped" ]]
42 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
44 echo "Nofitiy $(hostname -s):$2 stopped"
45 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=stopped&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY&service=$2" & 2> /dev
/null
46 echo $COMMAND > $SHARD_PATH/states
/$2.txt
48 elif [[ "$COMMAND" == "ShardStopped" ]]
50 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
52 echo "Nofitiy $(hostname -s):$2 shard stopped"
53 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=shard_stopped&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY" & 2> /dev
/null
54 echo $COMMAND > $SHARD_PATH/states
/shard.txt
56 elif [[ "$COMMAND" == "ShardStarted" ]]
58 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
60 echo "Nofitiy $(hostname -s):$2 shard started"
61 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=shard_started&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY" & 2> /dev
/null
62 echo $COMMAND > $SHARD_PATH/states
/shard.txt
64 elif [[ "$COMMAND" == "ShardStarting" ]]
66 if [[ ! -z "$NOTIFY_URL_SERVICE_RESTARTED" ]]
68 echo "Nofitiy $(hostname -s):$2 shard starting"
69 curl
"$NOTIFY_URL_SERVICE_RESTARTED?command=shard_starting&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY" & 2> /dev
/null
70 echo $COMMAND > $SHARD_PATH/states
/shard.txt