diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-09 19:16:22 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-09 19:16:22 -0500 |
| commit | 8ed238750fe2b11e86f626a8fb47b90a4962b795 (patch) | |
| tree | 6556f99e2838a0d150f155033af2d212884acef9 /servers.sh | |
| parent | 3c827e40cc1d41b6c342734f32430970eef0f21b (diff) | |
| download | webpage-8ed238750fe2b11e86f626a8fb47b90a4962b795.tar.gz webpage-8ed238750fe2b11e86f626a8fb47b90a4962b795.tar.bz2 webpage-8ed238750fe2b11e86f626a8fb47b90a4962b795.zip | |
Added more to server registration script
Diffstat (limited to 'servers.sh')
| -rw-r--r-- | servers.sh | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -3,7 +3,7 @@ . /usr/local/bin/bashlib servername=`param hostname` -gamemodename=`param gamemode` +serverip=`param ip` add=`param online` @@ -16,17 +16,36 @@ echo "<body>" #It seems quotes are enough,see #https://stackoverflow.com/questions/4273074/sanitize-user-input-in-bash-for-security-purposes echo "hostname:$servername" -echo "gamemode:$gamemodename" +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 echo "Server $servername added" - ls +else + #Remove the server from servers.txt fi echo "<p>Servers currently running Winter Survival 2 - Anarchy:<br/>" + +cat servers.txt | while read line +do + allparts=$(echo "$line" | tr " " "\n") + steamip="" + htmlname="" + for x in $allparts + do + if ( $steamip -eq "" ) then + steamip="$x" + else + htmlname="$htmlname $x" + fi + done + echo -n "<a href=\"steam://connect/$steamip>$htmlname</a>" +done + echo "</body>" cat ./fileparts/footer.html |
