Skip to content

Commit

Permalink
Allow binding to 0.0.0.0 and monitor localhost if needed
Browse files Browse the repository at this point in the history
Fixes #1770
Changed fail for warn
  • Loading branch information
UltimateByte committed Mar 14, 2018
1 parent 0dc2b64 commit b623e06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
30 changes: 14 additions & 16 deletions lgsm/functions/check_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,53 +24,51 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
sleep 1
# Multiple interfaces
if [ "${getipwc}" -ge "2" ]; then
fn_print_fail "Check IP: Multiple IP addresses found."
fn_print_warn "Check IP: Multiple IP addresses found."
sleep 1
echo -en "\n"
# IP is set within game config
if [ "${ipsetinconfig}" == "1" ]; then
fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
echo -en " * location: ${servercfgfullpath}\n"
echo -en "\n"
echo -en "Set ${ipinconfigvar} to one of the following:\n"
fn_script_log_fatal "Multiple IP addresses found."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
echo -en "You should set ${ipinconfigvar} to one of the following:\n"
fn_script_log_warn "Multiple IP addresses found."
fn_script_log_warn "You should specify the IP you want to bind within: ${servercfgfullpath}."
# IP is set within LinuxGSM config
else
fn_print_information_nl "Specify the IP you want to bind within a LinuxGSM config file.\n"
fn_print_information_nl "You should specify the IP you want to bind within a LinuxGSM config file.\n"
echo -en " * location: ${configdirserver}\n"
echo -en "\n"
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
fn_script_log_fatal "Multiple IP addresses found."
fn_script_log_warn "Multiple IP addresses found."
if [ "${legacymode}" == "1" ]; then
fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script."
fn_script_log_warn "You should specify the IP you want to bind within the ${selfname} script."
else
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
fn_script_log_warn "You should specify the IP you want to bind within: ${configdirserver}."
fi
fi
echo -en "${getip}\n"
echo -en "\n"
echo -en "https://gameservermanagers.com/network-interfaces\n"
echo -en ""
fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n"
core_exit.sh
fn_script_log_warn "https://gameservermanagers.com/network-interfaces\n"
# Single interface
elif [ "${ipsetinconfig}" == "1" ]; then
fn_print_fail "Check IP: IP address not set in game config."
fn_print_warn "Check IP: IP address not set in game config."
sleep 1
echo -en "\n"
fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
fn_print_information "You might want to specify the IP you want to bind within ${servercfg}.\n"
echo -en " * location: ${servercfgfullpath}\n"
echo -en "\n"
echo -en "Set ${ipinconfigvar} to the following:\n"
echo -en "${getip}\n"
echo -en "\n"
echo -en "https://gameservermanagers.com/network-interfaces\n"
echo -en ""
fn_script_log_fatal "IP address not set in game config."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n"
core_exit.sh
fn_script_log_warn "IP address not set in game config."
fn_script_log_warn "You might want to specify the IP you want to bind within: ${servercfgfullpath}."
fn_script_log_warn "https://gameservermanagers.com/network-interfaces\n"
else
ip="${getip}"
fi
Expand Down
5 changes: 4 additions & 1 deletion lgsm/functions/command_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ sleep 1
check.sh
logs.sh
info_config.sh

# If IP is not defined, then query on localhost
if [ "${ip}" == "0.0.0.0" ]||[ -z "${ip}" ]; then
ip="127.0.0.1"
fi
fn_monitor_check_lockfile
fn_monitor_check_update
fn_monitor_msg_checking
Expand Down

0 comments on commit b623e06

Please sign in to comment.