forked from GameServerManagers/LinuxGSM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new developer commands for parsing game and distro details
- Loading branch information
Showing
4 changed files
with
180 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/bin/bash | ||
# LinuxGSM command_dev_parse_distro_details.sh module | ||
# Author: Daniel Gibbs | ||
# Contributors: http://linuxgsm.com/contrib | ||
# Website: https://linuxgsm.com | ||
# Description: Display parsed distro details. | ||
|
||
info_distro.sh | ||
|
||
# Create an associative array of the server details. | ||
declare -A server_details=( | ||
['.NET Version']="${dotnetversion}" | ||
['Arch']="${arch}" | ||
['Avail Space']="${availspace}" | ||
['Backup Count']="${backupcount}" | ||
['Backup Dir DU']="${backupdirdu}" | ||
['CPU Cores']="${cpucores}" | ||
['CPU Frequency']="${cpufreqency}" | ||
['CPU Model']="${cpumodel}" | ||
['CPU Used MHz']="${cpuusedmhz}" | ||
['CPU Used']="${cpuused}" | ||
['Days']="${days}" | ||
['Distro Codename']="${distrocodename}" | ||
['Distro ID Like']="${distroidlike}" | ||
['Distro ID']="${distroid}" | ||
['Distro Info Array']="${distro_info_array}" | ||
['Distro Name']="${distroname}" | ||
['Distro Support']="${distrosupport}" | ||
['Distro Version CSV']="${distroversioncsv}" | ||
['Distro Version RH']="${distroversionrh}" | ||
['Distro Version']="${distroversion}" | ||
['Distros Unsupported Array']="${distrosunsupported_array}" | ||
['Distros Unsupported']="${distrosunsupported}" | ||
['File System']="${filesystem}" | ||
['Game Server PID']="${gameserverpid}" | ||
['GLIBC Version']="${glibcversion}" | ||
['GLIBC']="${glibc}" | ||
['HLDS Linux PID']="${hldslinuxpid}" | ||
['Hours']="${hours}" | ||
['Human Readable']="${humanreadable}" | ||
['Java Version']="${javaversion}" | ||
['Kernel']="${kernel}" | ||
['Last Backup Date']="${lastbackupdate}" | ||
['Last Backup Days Ago']="${lastbackupdaysago}" | ||
['Last Backup Size']="${lastbackupsize}" | ||
['Last Backup']="${lastbackup}" | ||
['Load']="${load}" | ||
['Mem Used MB']="${memusedmb}" | ||
['Mem Used Pct']="${memusedpct}" | ||
['Minutes']="${minutes}" | ||
['Module Self Name']="${moduleselfname}" | ||
['Mono Version']="${monoversion}" | ||
['Net Int']="${netint}" | ||
['Net Link']="${netlink}" | ||
['Old Free']="${oldfree}" | ||
['Phys Mem Actual Free KB']="${physmemactualfreekb}" | ||
['Phys Mem Available']="${physmemavailable}" | ||
['Phys Mem Buffers KB']="${physmembufferskb}" | ||
['Phys Mem Cached KB']="${physmemcachedkb}" | ||
['Phys Mem Cached']="${physmemcached}" | ||
['Phys Mem Free KB']="${physmemfreekb}" | ||
['Phys Mem Free']="${physmemfree}" | ||
['Phys Mem Reclaimable KB']="${physmemreclaimablekb}" | ||
['Phys Mem Total GB']="${physmemtotalgb}" | ||
['Phys Mem Total KB']="${physmemtotalkb}" | ||
['Phys Mem Total MB']="${physmemtotalmb}" | ||
['Phys Mem Total']="${physmemtotal}" | ||
['Phys Mem Used']="${physmemused}" | ||
['Root Dir DU Ex Backup']="${rootdirduexbackup}" | ||
['Root Dir DU']="${rootdirdu}" | ||
['Server Files DU']="${serverfilesdu}" | ||
['SRCDS Linux PID']="${srcdslinuxpid}" | ||
['SS Info']="${ssinfo}" | ||
['Swap Free']="${swapfree}" | ||
['Swap Total']="${swaptotal}" | ||
['Swap Used']="${swapused}" | ||
['Tmux Version']="${tmuxversion}" | ||
['Total Space']="${totalspace}" | ||
['Uptime']="${uptime}" | ||
['Used Space']="${usedspace}" | ||
['Virtual Environment']="${virtualenvironment}" | ||
) | ||
|
||
# Initialize a variable to keep track of missing distro details. | ||
missing_details="" | ||
|
||
# Loop through the distro details and output them. | ||
echo -e "" | ||
echo -e "${bold}${lightgreen}Available Distro Details${default}" | ||
fn_messages_separator | ||
for key in "${!server_details[@]}"; do | ||
value=${server_details[$key]} | ||
if [ -z "$value" ]; then | ||
missing_details+="\n${key}" | ||
else | ||
echo -e "$key: $value " | ||
fi | ||
done | ||
|
||
# Output the missing distro details if there are any. | ||
if [ -n "$missing_details" ]; then | ||
echo -e "" | ||
echo -e "${lightgreen}Missing or unsupported Dsitro Details${default}" | ||
fn_messages_separator | ||
echo -e "${missing_details}" | sort | ||
fi | ||
|
||
core_exit.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters