Advertisement
Guest User

Untitled

a guest
Jul 6th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. B3_LOG="/var/log/urbanterror/b3/status.xml"
  4.  
  5. case $1 in
  6.   autoconf)
  7.     echo "yes"
  8.     exit 0;;
  9.   config)
  10.     cat <<'EOM'
  11. graph_title Urban Terror player count
  12. graph_args --base 1000 -l 0
  13. graph_vlabel player
  14. graph_scale yes
  15. graph_category games
  16. graph_printf %3.0lf
  17. player.label player
  18. player.draw LINE2
  19. player.info Number of connected players
  20. player.colour 00FF00
  21. EOM
  22.     exit 0;;
  23. esac
  24.  
  25. B3_RUNNING=$(ps -efl | grep -v grep | grep b3_run.py | wc -l)
  26.  
  27. if [ $B3_RUNNING -ne 0 ]; then
  28.   PLAYER_CUR=$(cat $B3_LOG | grep "Clients Total" | cut -d "\"" -f2)
  29. else
  30.   PLAYER_CUR="0"
  31. fi
  32.  
  33. echo "player.value $PLAYER_CUR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement