|
@ -12,15 +12,15 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
|
fn_start_teamspeak3(){ |
|
|
fn_start_teamspeak3(){ |
|
|
if [ ! -e "${servercfgfullpath}" ]; then |
|
|
if [ ! -e "${servercfgfullpath}" ]; then |
|
|
fn_print_warn_nl "${servercfgfullpath} is missing" |
|
|
fn_print_warn_nl "${servercfgfullpath} is missing" |
|
|
fn_script_log "${servercfgfullpath} is missing" |
|
|
fn_script_log_warn "${servercfgfullpath} is missing" |
|
|
echo " * Creating blank ${servercfg}" |
|
|
echo " * Creating blank ${servercfg}" |
|
|
fn_script_log "Creating blank ${servercfg}" |
|
|
fn_script_log_info "Creating blank ${servercfg}" |
|
|
sleep 2 |
|
|
sleep 2 |
|
|
echo " * ${servercfg} can remain blank by default." |
|
|
echo " * ${servercfg} can remain blank by default." |
|
|
fn_script_log "${servercfgfullpath} can remain blank by default." |
|
|
fn_script_log_info "${servercfgfullpath} can remain blank by default." |
|
|
sleep 2 |
|
|
sleep 2 |
|
|
echo " * ${servercfg} is located in ${servercfgfullpath}." |
|
|
echo " * ${servercfg} is located in ${servercfgfullpath}." |
|
|
fn_script_log "${servercfg} is located in ${servercfgfullpath}." |
|
|
fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." |
|
|
sleep 5 |
|
|
sleep 5 |
|
|
touch "${servercfgfullpath}" |
|
|
touch "${servercfgfullpath}" |
|
|
fi |
|
|
fi |
|
@ -31,8 +31,8 @@ fn_start_teamspeak3(){ |
|
|
check_status.sh |
|
|
check_status.sh |
|
|
if [ "${status}" != "0" ]; then |
|
|
if [ "${status}" != "0" ]; then |
|
|
fn_print_info_nl "${servername} is already running" |
|
|
fn_print_info_nl "${servername} is already running" |
|
|
fn_script_log "${servername} is already running" |
|
|
fn_script_log_error "${servername} is already running" |
|
|
exit |
|
|
core_exit.sh |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
mv "${scriptlog}" "${scriptlogdate}" |
|
|
mv "${scriptlog}" "${scriptlogdate}" |
|
@ -48,12 +48,12 @@ fn_start_teamspeak3(){ |
|
|
check_status.sh |
|
|
check_status.sh |
|
|
if [ "${status}" == "0" ]; then |
|
|
if [ "${status}" == "0" ]; then |
|
|
fn_print_fail_nl "Unable to start ${servername}" |
|
|
fn_print_fail_nl "Unable to start ${servername}" |
|
|
fn_script_log "Unable to start ${servername}" |
|
|
fn_script_log_fatal "Unable to start ${servername}" |
|
|
echo -e " Check log files: ${rootdir}/log" |
|
|
echo -e " Check log files: ${rootdir}/log" |
|
|
exit 1 |
|
|
core_exit.sh |
|
|
else |
|
|
else |
|
|
fn_print_ok_nl "${servername}" |
|
|
fn_print_ok_nl "${servername}" |
|
|
fn_script_log "Started ${servername}" |
|
|
fn_script_log_pass "Started ${servername}" |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -66,7 +66,7 @@ fn_start_tmux(){ |
|
|
# Log rotation |
|
|
# Log rotation |
|
|
check_status.sh |
|
|
check_status.sh |
|
|
if [ "${status}" == "0" ]; then |
|
|
if [ "${status}" == "0" ]; then |
|
|
fn_script_log "Rotating log files" |
|
|
fn_script_log_info "Rotating log files" |
|
|
if [ "${engine}" == "unreal2" ]; then |
|
|
if [ "${engine}" == "unreal2" ]; then |
|
|
if [ -f "${gamelog}" ]; then |
|
|
if [ -f "${gamelog}" ]; then |
|
|
mv "${gamelog}" "${gamelogdate}" |
|
|
mv "${gamelog}" "${gamelogdate}" |
|
@ -80,8 +80,8 @@ fn_start_tmux(){ |
|
|
check_status.sh |
|
|
check_status.sh |
|
|
if [ "${status}" != "0" ]; then |
|
|
if [ "${status}" != "0" ]; then |
|
|
fn_print_info_nl "${servername} is already running" |
|
|
fn_print_info_nl "${servername} is already running" |
|
|
fn_script_log "${servername} is already running" |
|
|
fn_script_log_error "${servername} is already running" |
|
|
exit |
|
|
core_exit.sh |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Create lock file |
|
|
# Create lock file |
|
@ -118,11 +118,11 @@ fn_start_tmux(){ |
|
|
check_status.sh |
|
|
check_status.sh |
|
|
if [ "${status}" == "0" ]; then |
|
|
if [ "${status}" == "0" ]; then |
|
|
fn_print_fail_nl "Unable to start ${servername}" |
|
|
fn_print_fail_nl "Unable to start ${servername}" |
|
|
fn_script_log "Unable to start ${servername}" |
|
|
fn_script_log_fatal "Unable to start ${servername}" |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then |
|
|
if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then |
|
|
fn_print_fail_nl "Unable to start ${servername}: Tmux error:" |
|
|
fn_print_fail_nl "Unable to start ${servername}: Tmux error:" |
|
|
fn_script_log "Tmux error" |
|
|
fn_script_log_fatal "Unable to start ${servername}: Tmux error:" |
|
|
echo "" |
|
|
echo "" |
|
|
echo "Command" |
|
|
echo "Command" |
|
|
echo "=================================" |
|
|
echo "=================================" |
|
@ -139,30 +139,31 @@ fn_start_tmux(){ |
|
|
echo "=================================" |
|
|
echo "=================================" |
|
|
if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then |
|
|
if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then |
|
|
echo "$(whoami) is not part of the tty group." |
|
|
echo "$(whoami) is not part of the tty group." |
|
|
fn_script_log "$(whoami) is not part of the tty group." |
|
|
fn_script_log_info "$(whoami) is not part of the tty group." |
|
|
group=$(grep tty /etc/group) |
|
|
group=$(grep tty /etc/group) |
|
|
echo "" |
|
|
echo "" |
|
|
echo " ${group}" |
|
|
echo " ${group}" |
|
|
fn_script_log "${group}" |
|
|
fn_script_log_info "${group}" |
|
|
echo "" |
|
|
echo "" |
|
|
echo "Run the following command with root privileges." |
|
|
echo "Run the following command with root privileges." |
|
|
echo "" |
|
|
echo "" |
|
|
echo " usermod -G tty $(whoami)" |
|
|
echo " usermod -G tty $(whoami)" |
|
|
echo "" |
|
|
echo "" |
|
|
echo "https://gameservermanagers.com/tmux-op-perm" |
|
|
echo "https://gameservermanagers.com/tmux-op-perm" |
|
|
fn_script_log "https://gameservermanagers.com/tmux-op-perm" |
|
|
fn_script_log_info "https://gameservermanagers.com/tmux-op-perm" |
|
|
else |
|
|
else |
|
|
echo "No known fix currently. Please log an issue." |
|
|
echo "No known fix currently. Please log an issue." |
|
|
fn_script_log "No known fix currently. Please log an issue." |
|
|
fn_script_log_info "No known fix currently. Please log an issue." |
|
|
echo "https://gameservermanagers.com/issues" |
|
|
echo "https://gameservermanagers.com/issues" |
|
|
fn_script_log "https://gameservermanagers.com/issues" |
|
|
fn_script_log_info "https://gameservermanagers.com/issues" |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
exit 1 |
|
|
|
|
|
|
|
|
core_exit.sh |
|
|
else |
|
|
else |
|
|
fn_print_ok "${servername}" |
|
|
fn_print_ok "${servername}" |
|
|
fn_script_log "Started ${servername}" |
|
|
fn_script_log_pass "Started ${servername}" |
|
|
fi |
|
|
fi |
|
|
rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
|
rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
|
echo -en "\n" |
|
|
echo -en "\n" |
|
|