-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprint_restart_reminder.sh
More file actions
executable file
·26 lines (22 loc) · 1.03 KB
/
print_restart_reminder.sh
File metadata and controls
executable file
·26 lines (22 loc) · 1.03 KB
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
#!/bin/bash
export SCRIPT_DIR=$( cd "$( dirname "$0" )" && pwd )
source ${SCRIPT_DIR}/lib/minecraft_server_control.sh
source ${SCRIPT_DIR}/lib/discord_utils.sh
print_restart_reminder()
{
local number_of_minutes=$1
local minecraft_message=""
local discord_message=""
if [ ${number_of_minutes} -eq 1 ]; then
minecraft_message="[Server] The server will restart in ${number_of_minutes} minute!"
discord_message=":warning: **The server will restart in ${number_of_minutes} minute!** :warning:"
else
minecraft_message="[Server] The server will restart in ${number_of_minutes} minutes!"
discord_message=":warning: **The server will restart in ${number_of_minutes} minutes!** :warning:"
fi
tellraw_in_minecraft "[Server] ----------- ATTENTION! -----------" "yellow" "bold,italic"
tellraw_in_minecraft "${minecraft_message}" "yellow" "bold,italic"
tellraw_in_minecraft "[Server] ---------------------------------" "yellow" "bold,italic"
send_message_to_discord "${discord_message}" "Server Restart"
}
print_restart_reminder $1