I need a bash script that checks the cs2d server list webpage (http://www.cs2d.com/servers.php) if it contains the IP of my server.
I already have a script, but it seems to be not working as I want:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
webserv="http://www.cs2d.com/servers.php"
Keyword="MY-SERVER-IP" # enter the keyword for test content
if curl -s "$webserv" | grep "$keyword"
then
# if the keyword is in the conent
echo " server online"
else
echo "Error"
fi
I changed the Keyword text to my server IP, but always get the same echo " server online" even if the IP doesnt show up in the server list.
Can someone help me, please?

edited 2×, last 15.04.17 04:12:39 pm