Browse Source

Updated function

pull/743/head
Daniel Gibbs 9 years ago
parent
commit
d99a7e2b43
  1. 2
      functions/command_monitor.sh
  2. 18
      functions/command_start.sh
  3. 2
      functions/core_messages.sh

2
functions/command_monitor.sh

@ -83,7 +83,7 @@ fn_monitor_tmux(){
done done
exit exit
else else
fn_print_fail "Checking session: FAIL" fn_print_fail "Checking session: "
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_scriptlog "Checking session: FAIL" fn_scriptlog "Checking session: FAIL"
fn_monitor_email_notification fn_monitor_email_notification

18
functions/command_start.sh

@ -21,10 +21,8 @@ if [ "${ts3status}" != "Server is running" ]; then
fi fi
if [ ! -e "${servercfgfullpath}" ]; then if [ ! -e "${servercfgfullpath}" ]; then
fn_print_warn "${servercfgfullpath} is missing" fn_print_warn_nl "${servercfgfullpath} is missing"
fn_scriptlog "${servercfgfullpath} is missing" fn_scriptlog "${servercfgfullpath} is missing"
sleep 2
echo -en "\n"
echo " * Creating blank ${servercfg}" echo " * Creating blank ${servercfg}"
fn_scriptlog "Creating blank ${servercfg}" fn_scriptlog "Creating blank ${servercfg}"
sleep 2 sleep 2
@ -44,10 +42,8 @@ fn_scriptlog "${servername}"
sleep 1 sleep 1
if [ "${ts3status}" == "Server is running" ]; then if [ "${ts3status}" == "Server is running" ]; then
fn_print_info "${servername} is already running" fn_print_info_nl "${servername} is already running"
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
sleep 1
echo -en "\n"
exit exit
fi fi
@ -68,11 +64,9 @@ if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No serv
echo -e " Check log files: ${rootdir}/log" echo -e " Check log files: ${rootdir}/log"
exit 1 exit 1
else else
fn_print_ok "${servername}" fn_print_ok_nl "${servername}"
fn_scriptlog "Started ${servername}" fn_scriptlog "Started ${servername}"
fi fi
sleep 0.5
echo -en "\n"
} }
fn_start_tmux(){ fn_start_tmux(){
@ -139,13 +133,11 @@ if [ "${tmuxwc}" -eq 0 ]; then
echo "" echo ""
echo "Command" echo "Command"
echo "=================================" echo "================================="
echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" | tee -a "${scriptlog}"
echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" >> "${scriptlog}"
echo "" echo ""
echo "Error" echo "Error"
echo "=================================" echo "================================="
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" | tee -a "${scriptlog}"
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}"
# Detected error http://gameservermanagers.com/issues # Detected error http://gameservermanagers.com/issues
if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then

2
functions/core_messages.sh

@ -140,7 +140,7 @@ fn_print_error_nl(){
echo -e "\e[0;31mError!\e[0m $@" echo -e "\e[0;31mError!\e[0m $@"
} }
# Info! # Infomation!
fn_print_infomation(){ fn_print_infomation(){
echo -en "\e[0;36mInfomation!\e[0m $@" echo -en "\e[0;36mInfomation!\e[0m $@"
} }

Loading…
Cancel
Save