mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-07 06:41:17 +00:00
Add uptime to status.
Updated docs.
This commit is contained in:
parent
71f381ec3d
commit
e71ed82871
2 changed files with 47 additions and 36 deletions
|
@ -152,8 +152,16 @@ the running container:
|
||||||
docker compose exec main bash
|
docker compose exec main bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or open a shell into a new container if the docker stack is not up:
|
||||||
|
```
|
||||||
|
docker compose run --rm main bash
|
||||||
|
```
|
||||||
|
|
||||||
|
All the files used by the server are in a docker volume. Any change made will be reflected upon the next container startup.
|
||||||
|
|
||||||
Use this shell cautiously.
|
Use this shell cautiously.
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* Create some way to send messages to players on the server using RCON.
|
* Create some way to send messages to players on the server using RCON.
|
||||||
|
* Implement multiple ids for mod commands.
|
||||||
|
|
|
@ -266,8 +266,7 @@ fn_install_dayz(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_runupdate_dayz(){
|
fn_config(){
|
||||||
fn_steamlogin_dayz
|
|
||||||
if ! diff -q "${SERVER_CFG_SRC}" "${SERVER_CFG_DST}"
|
if ! diff -q "${SERVER_CFG_SRC}" "${SERVER_CFG_DST}"
|
||||||
then
|
then
|
||||||
echo "========================================================================="
|
echo "========================================================================="
|
||||||
|
@ -281,7 +280,6 @@ fn_runupdate_dayz(){
|
||||||
echo "NOT updating the server configuration file"
|
echo "NOT updating the server configuration file"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${appid}" +quit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_update_dayz(){
|
fn_update_dayz(){
|
||||||
|
@ -313,7 +311,8 @@ fn_update_dayz(){
|
||||||
printf "\thttps://steamdb.info/app/${appid}/\n"
|
printf "\thttps://steamdb.info/app/${appid}/\n"
|
||||||
printf "\nApplying update"
|
printf "\nApplying update"
|
||||||
# run update
|
# run update
|
||||||
fn_runupdate_dayz
|
fn_steamlogin_dayz
|
||||||
|
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${appid}" +quit
|
||||||
fn_update_mods
|
fn_update_mods
|
||||||
else
|
else
|
||||||
printf "\r[ ${green}OK${default} ] Checking for update:: No update available\n"
|
printf "\r[ ${green}OK${default} ] Checking for update:: No update available\n"
|
||||||
|
@ -525,41 +524,43 @@ fn_rcon(){
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_status(){
|
fn_status(){
|
||||||
INSTALLED="${NO}"
|
INSTALLED="${NO}"
|
||||||
LOGGED_IN="${NO}"
|
LOGGED_IN="${NO}"
|
||||||
RUNNING="${NO}"
|
RUNNING="${NO}"
|
||||||
fn_get_mods
|
fn_get_mods
|
||||||
MOD_INSTALLED="${green}${#workshopID[@]}${default}"
|
MODS_INSTALLED="${green}${#workshopID[@]}${default}"
|
||||||
MOD_LIST=""
|
# DayZ Server files installation
|
||||||
# DayZ Server files installation
|
if [ -f "${SERVER_INSTALL_FILE}" ]
|
||||||
if [ -f "${SERVER_INSTALL_FILE}" ]
|
then
|
||||||
then
|
INSTALLED="${YES}"
|
||||||
INSTALLED="${YES}"
|
fi
|
||||||
fi
|
# Logged into Steam
|
||||||
# Logged into Steam
|
if [ -f "${STEAM_LOGIN}" ]
|
||||||
if [ -f "${STEAM_LOGIN}" ]
|
then
|
||||||
then
|
LOGGED_IN="${YES}"
|
||||||
LOGGED_IN="${YES}"
|
if grep -q anonymous "${STEAM_LOGIN}"
|
||||||
if grep -q anonymous "${STEAM_LOGIN}"
|
then
|
||||||
then
|
ANONYMOUS="${yellow}(as anonymous)${default}"
|
||||||
ANONYMOUS="(as anonymous)"
|
else
|
||||||
else
|
ANONYMOUS="${green}(not anonymous)${default}"
|
||||||
ANONYMOUS="(not anonymous)"
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
# Running or not
|
||||||
# Running or not
|
if pidof DayZServer > /dev/null
|
||||||
if pidof DayZServer > /dev/null
|
then
|
||||||
then
|
RUNNING="${YES}"
|
||||||
RUNNING="${YES}"
|
fi
|
||||||
fi
|
fn_mod_cmd
|
||||||
fn_mod_cmd
|
# Uptime
|
||||||
# Number of mods plus the list denoting on or off
|
UPTIME=$(date -d@$(($(date +%s) - $(date +%s -r ${SERVER_PROFILE}/server_console.log))) -u +%H:%M:%S)
|
||||||
echo -e "
|
# Number of mods plus the list denoting on or off
|
||||||
|
echo -e "
|
||||||
Status:
|
Status:
|
||||||
|
|
||||||
|
Uptime: ${green}${UPTIME}${default}
|
||||||
Logged in to Steam: ${LOGGED_IN} ${ANONYMOUS}
|
Logged in to Steam: ${LOGGED_IN} ${ANONYMOUS}
|
||||||
Server files installed: ${INSTALLED}
|
Server files installed: ${INSTALLED}
|
||||||
Mods installed: ${MOD_INSTALLED}${MOD_LIST}
|
Mods installed: ${MODS_INSTALLED}
|
||||||
Server running: ${RUNNING}
|
Server running: ${RUNNING}
|
||||||
Default parameters:${dayzparameter}
|
Default parameters:${dayzparameter}
|
||||||
Mod parameter: ${mod_command_line}
|
Mod parameter: ${mod_command_line}
|
||||||
|
@ -570,6 +571,9 @@ case "${1}" in
|
||||||
cmd)
|
cmd)
|
||||||
fn_mod_cmd
|
fn_mod_cmd
|
||||||
;;
|
;;
|
||||||
|
config)
|
||||||
|
fn_config
|
||||||
|
;;
|
||||||
install)
|
install)
|
||||||
fn_loadconfig_dayz
|
fn_loadconfig_dayz
|
||||||
fn_install_dayz
|
fn_install_dayz
|
||||||
|
@ -595,7 +599,6 @@ case "${1}" in
|
||||||
fn_stop_dayz
|
fn_stop_dayz
|
||||||
;;
|
;;
|
||||||
update)
|
update)
|
||||||
fn_runupdate_dayz
|
|
||||||
fn_loadconfig_dayz
|
fn_loadconfig_dayz
|
||||||
fn_update_dayz
|
fn_update_dayz
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue