I have several of urban terror server, and I wrote a script which checkes for something and removes it. So I check it with a a little bash script on my linux maschine and it works. This is what I used:
Quote
printf '\xFF\xFF\xFF\xFFrcon rconpassword rconbefehl\n' | nc -u -n -w 1 ip port | sed -ne ':x;/\xFF/{N;s/\xFF\xFF\xFF\xFFprint\n//;tx};/^$/d;p'
like I said the script works but it has 1387 lines of code because the for-loop in bash didnt work. So here is it how I tried with the for-loop:
Quote
for i in 18
do
player = i
printf '\xFF\xFF\xFF\xFFrcon rconpassword dumpuser $i\n' | nc -u -n -w 1 ip port | sed -ne ':x;/\xFF/{N;s/\xFF\xFF\xFF\xFFprint\n//;tx};/^$/d;p'
done
do
player = i
printf '\xFF\xFF\xFF\xFFrcon rconpassword dumpuser $i\n' | nc -u -n -w 1 ip port | sed -ne ':x;/\xFF/{N;s/\xFF\xFF\xFF\xFFprint\n//;tx};/^$/d;p'
done
this doesnt work so my main question about it: is there another way to do it or what is wrong with it?
greez