From 7de4c741547654edfd1a2c585ef64c33b5940b33 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 9 Jan 2016 20:11:19 -0500 Subject: Fixed servers listing --- servers.sh | 13 ++++++------- servers.txt | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 servers.txt diff --git a/servers.sh b/servers.sh index 5658daf..28cbbc5 100644 --- a/servers.sh +++ b/servers.sh @@ -1,7 +1,5 @@ -. /usr/local/bin/bashlib - servername=`param hostname` serverip=`param ip` add=`param online` @@ -20,10 +18,11 @@ echo "hostip:$serverip" echo "online:$add" #Be sure servers.txt has 666 permissions (or at least make sure your web server group can write to it) -if ( $add -eq "true" ) then - echo "$servername" >> ./servers.txt +if [ "$add" = "true" ]; then + echo "$serverip $servername" >> ./servers.txt echo "Server $servername added" else + echo "" #Remove the server from servers.txt fi @@ -31,20 +30,20 @@ fi echo "

Servers currently running Winter Survival 2 - Anarchy:
" -cat servers.txt | while read line +cat ./servers.txt | while read line do allparts=$(echo "$line" | tr " " "\n") steamip="" htmlname="" for x in $allparts do - if ( $steamip -eq "" ) then + if [ "$steamip" = "" ]; then steamip="$x" else htmlname="$htmlname $x" fi done - echo -n "$htmlname" + echo -n "$htmlname
" done echo "" diff --git a/servers.txt b/servers.txt new file mode 100644 index 0000000..e2122f6 --- /dev/null +++ b/servers.txt @@ -0,0 +1,4 @@ +127.0.0.1:81 AlecsOtherwise +127.0.0.1:81 AlecsOtherwise +127.0.0.1:81 AlecsOtherwise +127.0.0.1:81 AlecsOtherwise -- cgit v1.2.3-70-g09d2