Browse Source

allow accurate ip to be set for webadminip in most cases

pull/3041/head
Daniel Gibbs 5 years ago
parent
commit
6bcf0d8089
  1. 14
      lgsm/functions/check_ip.sh
  2. 12
      lgsm/functions/info_messages.sh

14
lgsm/functions/check_ip.sh

@ -23,13 +23,21 @@ getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\
# If the IP variable has been set by user.
if [ -n "${ip}" ]&&[ "${ip}" != "0.0.0.0" ]; then
queryips=( "${ip}" )
# If game config does have an IP set.
webadminip=( "${ip}" )
# If game config does have an IP set.
elif [ -n "${configip}" ]&&[ "${configip}" != "0.0.0.0" ];then
queryips=( "${configip}" )
ip="${configip}"
# If no ip is set by the user.
webadminip=( "${configip}" )
# If there is only 1 server IP address.
# Some IP details can automaticly use the one IP
elif [ "${getipwc}" == "1" ]; then
queryips=( $(echo "${getip}") )
ip="0.0.0.0"
webadminip=( "${getip}" )
# If no ip is set by the user and server has more than one IP.
else
queryips=( $(echo "${getip}") )
ip="0.0.0.0"
# If IP has not been set by user.
webadminip=( "${ip}" )
fi

12
lgsm/functions/info_messages.sh

@ -1115,7 +1115,7 @@ fn_info_message_sdtd(){
fn_messages_separator
{
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t
echo -e ""
@ -1162,7 +1162,7 @@ fn_info_message_spark(){
echo -e "${lightgreen}${servername} WebAdmin${default}"
fn_messages_separator
{
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}/index.html"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t
@ -1276,7 +1276,7 @@ fn_info_message_unreal(){
fn_messages_separator
{
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t
@ -1300,7 +1300,7 @@ fn_info_message_unreal2(){
fn_messages_separator
{
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t
@ -1321,7 +1321,7 @@ fn_info_message_unreal3(){
fn_messages_separator
{
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t
@ -1362,7 +1362,7 @@ fn_info_message_kf2(){
fn_messages_separator
{
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
} | column -s $'\t' -t

Loading…
Cancel
Save