|
|
@ -2,7 +2,7 @@ |
|
|
|
# LGSM fn_start function |
|
|
|
# Author: Daniel Gibbs |
|
|
|
# Website: http://gameservermanagers.com |
|
|
|
# Version: 220415 |
|
|
|
# Version: 070515 |
|
|
|
|
|
|
|
# Description: Starts the server. |
|
|
|
|
|
|
@ -119,26 +119,33 @@ else |
|
|
|
fi |
|
|
|
sleep 1 |
|
|
|
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
|
|
|
|
|
|
# If the server fails to start |
|
|
|
if [ "${tmuxwc}" -eq 0 ]; then |
|
|
|
fn_printfail "Unable to start ${servername}" |
|
|
|
fn_scriptlog "Unable to start ${servername}" |
|
|
|
sleep 1 |
|
|
|
if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then |
|
|
|
fn_printfail "Unable to start ${servername}: Tmux returned the following error:" |
|
|
|
fn_scriptlog "tmux returned the following error" |
|
|
|
fn_printfail "Unable to start ${servername}: Tmux error:" |
|
|
|
fn_scriptlog "Tmux error" |
|
|
|
sleep 1 |
|
|
|
echo -en "\n" |
|
|
|
echo "" |
|
|
|
echo "Command" |
|
|
|
echo "=================================" |
|
|
|
echo "tmux new-session -d -s ${servicename} "${executable} ${parms}"" |
|
|
|
echo "tmux new-session -d -s ${servicename} "${executable} ${parms}"" >> "${scriptlog}" |
|
|
|
echo "" |
|
|
|
echo "Error" |
|
|
|
echo "=================================" |
|
|
|
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
|
|
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}" |
|
|
|
sleep 1 |
|
|
|
echo "" |
|
|
|
|
|
|
|
# Detected error http://gameservermanagers.com/issues |
|
|
|
if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ];then |
|
|
|
echo "" |
|
|
|
echo "Fix" |
|
|
|
echo "=================================" |
|
|
|
if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ];then |
|
|
|
echo "=================================" |
|
|
|
echo "$(whoami) is not part of the tty group." |
|
|
|
fn_scriptlog "$(whoami) is not part of the tty group." |
|
|
|
group=$(grep tty /etc/group) |
|
|
@ -152,16 +159,9 @@ if [ "${tmuxwc}" -eq 0 ]; then |
|
|
|
echo "" |
|
|
|
echo "http://gameservermanagers.com/tmux-op-perm" |
|
|
|
fn_scriptlog "http://gameservermanagers.com/tmux-op-perm" |
|
|
|
echo "=================================" |
|
|
|
else |
|
|
|
echo "$(whoami) is part of the tty group." |
|
|
|
group=$(grep tty /etc/group) |
|
|
|
echo "" |
|
|
|
echo " ${group}" |
|
|
|
fn_scriptlog "${group}" |
|
|
|
echo "" |
|
|
|
echo "No known fix currently." |
|
|
|
fn_scriptlog "No known fix currently." |
|
|
|
echo "No known fix currently. Please log an issue." |
|
|
|
fn_scriptlog "No known fix currently. Please log an issue." |
|
|
|
echo "http://gameservermanagers.com/issues" |
|
|
|
fn_scriptlog "http://gameservermanagers.com/issues" |
|
|
|
fi |
|
|
|