Browse Source

First-pass at post-details functionality.

pull/1037/head
CedarLUG 9 years ago
parent
commit
907490d8fe
  1. 131
      lgsm/functions/command_details.sh
  2. 47
      lgsm/functions/command_postdetails.sh
  3. 9
      lgsm/functions/core_functions.sh
  4. 5
      lgsm/functions/core_getopt.sh

131
lgsm/functions/command_details.sh

@ -580,66 +580,73 @@ fn_details_ark(){
# Run checks and gathers details to display.
check.sh
info_config.sh
info_distro.sh
info_glibc.sh
info_parms.sh
fn_details_os
fn_details_performance
fn_details_disk
fn_details_gameserver
fn_details_script
fn_details_backup
# Some game servers do not have parms.
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
fn_parms
fn_details_commandlineparms
fi
fn_details_ports
# Display details depending on game or engine.
if [ "${engine}" == "avalanche" ]; then
fn_details_avalanche
elif [ "${engine}" == "dontstarve" ]; then
fn_details_dontstarve
elif [ "${engine}" == "lwjgl2" ]; then
fn_details_minecraft
elif [ "${engine}" == "projectzomboid" ]; then
fn_details_projectzomboid
elif [ "${engine}" == "idtech3" ]; then
fn_details_idtech3
elif [ "${engine}" == "realvirtuality" ]; then
fn_details_realvirtuality
elif [ "${engine}" == "seriousengine35" ]; then
fn_details_seriousengine35
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_details_source
elif [ "${engine}" == "spark" ]; then
fn_details_spark
elif [ "${engine}" == "starbound" ]; then
fn_details_starbound
elif [ "${engine}" == "teeworlds" ]; then
fn_details_teeworlds
elif [ "${engine}" == "terraria" ]; then
fn_details_terraria
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_details_unreal
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
fn_details_ark
elif [ "${gamename}" == "Hurtworld" ]; then
fn_details_hurtworld
elif [ "${gamename}" == "7 Days To Die" ]; then
fn_details_sdtd
elif [ "${gamename}" == "TeamSpeak 3" ]; then
fn_details_teamspeak3
elif [ "${gamename}" == "Mumble" ]; then
fn_details_mumble
elif [ "${gamename}" == "Rust" ]; then
fn_details_rust
else
fn_print_error_nl "Unable to detect server engine."
fi
fn_details_statusbottom
core_exit.sh
fn_display_details() {
check.sh
info_config.sh
info_distro.sh
info_glibc.sh
info_parms.sh
fn_details_os
fn_details_performance
fn_details_disk
fn_details_gameserver
fn_details_script
fn_details_backup
# Some game servers do not have parms.
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
fn_parms
fn_details_commandlineparms
fi
fn_details_ports
# Display details depending on game or engine.
if [ "${engine}" == "avalanche" ]; then
fn_details_avalanche
elif [ "${engine}" == "dontstarve" ]; then
fn_details_dontstarve
elif [ "${engine}" == "lwjgl2" ]; then
fn_details_minecraft
elif [ "${engine}" == "projectzomboid" ]; then
fn_details_projectzomboid
elif [ "${engine}" == "idtech3" ]; then
fn_details_idtech3
elif [ "${engine}" == "realvirtuality" ]; then
fn_details_realvirtuality
elif [ "${engine}" == "seriousengine35" ]; then
fn_details_seriousengine35
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_details_source
elif [ "${engine}" == "spark" ]; then
fn_details_spark
elif [ "${engine}" == "starbound" ]; then
fn_details_starbound
elif [ "${engine}" == "teeworlds" ]; then
fn_details_teeworlds
elif [ "${engine}" == "terraria" ]; then
fn_details_terraria
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_details_unreal
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
fn_details_ark
elif [ "${gamename}" == "Hurtworld" ]; then
fn_details_hurtworld
elif [ "${gamename}" == "7 Days To Die" ]; then
fn_details_sdtd
elif [ "${gamename}" == "TeamSpeak 3" ]; then
fn_details_teamspeak3
elif [ "${gamename}" == "Mumble" ]; then
fn_details_mumble
elif [ "${gamename}" == "Rust" ]; then
fn_details_rust
else
fn_print_error_nl "Unable to detect server engine."
fi
fn_details_statusbottom
}
if [ -z $postdetails ] ;
then
fn_display_details
core_exit.sh
fi

47
lgsm/functions/command_postdetails.sh

@ -0,0 +1,47 @@
#!/bin/bash
# LGSM command_details.sh function
# Author: Daniel Gibbs
# Contributor: UltimateByte
# Website: https://gameservermanagers.com
# Description: Displays server information.
local commandname="POSTDETAILS"
local commandaction="Postdetails"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
postdetails=yes
# source all of the functions defined in the details command
. ${functionsdir}/command_details.sh
#INPUT="$(</dev/stdin)"
fn_display_details | sed -e 's/password="[^"]*/password="--stripped--/' |
sed -e 's/password "[^"]*/password "--stripped--/' |
sed -e 's/password: .*/password: --stripped--/' |
sed -e 's/gslt="[^"]*/gslt="--stripped--/' |
sed -e 's/gslt "[^"]*/gslt "--stripped--/' |
sed -e 's/steamuser="[^"]*/steamuser="--stripped--/' |
sed -e 's/steamuser "[^"]*/steamuser "--stripped--/' |
sed -e 's/steampass="[^"]*/steampass="--stripped--/' |
sed -e 's/steampass "[^"]*/steampass "--stripped--/' |
sed -e 's/pushbullettoken="[^"]*/pushbullettoken="--stripped--/' |
sed -e 's/pushbullettoken "[^"]*/pushbullettoken "--stripped--/' |
sed -e 's/authkey="[^"]*/authkey="--stripped--/' |
sed -e 's/authkey "[^"]*/authkey "--stripped--/' |
sed -e 's/rcts_strAdminPassword="[^"]*/rcts_strAdminPassword="--stripped--/' |
sed -e 's/rcts_strAdminPassword "[^"]*/rcts_strAdminPassword "--stripped--/' |
sed -e 's/sv_password="[^"]*/sv_password="--stripped--/' |
sed -e 's/sv_password "[^"]*/sv_password "--stripped--/' |
sed -e 's/zmq_stats_password="[^"]*/zmq_stats_password="--stripped--/' |
sed -e 's/zmq_stats_password "[^"]*/zmq_stats_password "--stripped--/' |
sed -e 's/zmq_rcon_password="[^"]*/zmq_rcon_password="--stripped--/' |
sed -e 's/zmq_rcon_password "[^"]*/zmq_rcon_password "--stripped--/' |
sed -e 's/pass="[^"]*/pass="--stripped--/' |
sed -e 's/pass "[^"]*/pass "--stripped--/' |
sed -e 's/rconServerPassword="[^"]*/rconServerPassword="--stripped--/' |
sed -e 's/rconServerPassword "[^"]*/rconServerPassword "--stripped--/'
#querystring="paste_private=0&paste_name=${NAME}&paste_code=${INPUT}"
#curl -d "${querystring}" http://pastebin.com/api_public.php
core_exit.sh

9
lgsm/functions/core_functions.sh

@ -116,6 +116,15 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
command_postdetails.sh(){
functionfile="${FUNCNAME}"
tempffname=$functionfile
fn_fetch_function
functionfile="command_details.sh"
fn_fetch_function
functionfile=$tempffname
}
command_details.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function

5
lgsm/functions/core_getopt.sh

@ -27,6 +27,8 @@ case "${getopt}" in
command_monitor.sh;;
ta|test-alert)
command_test_alert.sh;;
pd|postdetails)
command_postdetails.sh;;
dt|details)
command_details.sh;;
b|backup)
@ -66,6 +68,7 @@ case "${getopt}" in
echo -e "${blue}monitor\t${default}m |Checks that the server is running."
echo -e "${blue}test-alert\t${default}ta |Sends test alert."
echo -e "${blue}details\t${default}dt |Displays useful information about the server."
echo -e "${blue}postdetails\t${default}pd | Post stripped details to pastebin (for support)"
echo -e "${blue}backup\t${default}b |Create archive of the server."
echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
@ -91,6 +94,8 @@ case "${getopt}" in
command_monitor.sh;;
ta|test-alert)
command_test_alert.sh;;
pd|postdetails)
command_postdetails.sh;;
dt|details)
command_details.sh;;
b|backup)

Loading…
Cancel
Save