From 52aba4d2c8c83d8ca44941bf4f2ce48fccaf05ca Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 24 Dec 2015 21:24:46 +0000 Subject: [PATCH] added more to check.sh --- functions/check.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 functions/check.sh diff --git a/functions/check.sh b/functions/check.sh new file mode 100644 index 000000000..140627aeb --- /dev/null +++ b/functions/check.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LGSM fn_check function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +lgsm_version="201215" + +# Description: Overall function for managing checks. +# Runs checks that will either halt on or fix an issue. + +fn_module_compare() { + local e + for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done + return 1 +} + + +check_root.sh + +if [ "${cmd}" != "install" ]; then + check_systemdir.sh +fi + +no_check_logs=( debug details install map-compressor ) +fn_module_compare "${cmd}" "${no_check_logs[@]}" +if [ $? != 0 ]; then + fn_check_logs +fi + +check_ip=( debug ) +fn_module_compare "${cmd}" "${no_check_logs[@]}" +if [ $? != 0 ]; then + check_ip.sh +fi + +check_ip=( debug ) +fn_module_compare "${cmd}" "${no_check_logs[@]}" +if [ $? != 0 ]; then + check_steamuser.sh + check_steamcmd.sh +fi + +check_ip=( start ) +fn_module_compare "${cmd}" "${no_check_logs[@]}" +if [ $? != 0 ]; then + check_tmux.sh +fi + +#fn_check_ts3status # may need to move out of checks \ No newline at end of file