Recent Posts
None | 38 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Ruby | 1 min ago
None | 2 min ago
Bash | 3 min ago
None | 3 min ago
None | 3 min ago
None | 5 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Feb 2010 07:53:23 PM Download | Raw | Embed | Report
  1. #!/usr/bin/perl
  2.  
  3. #processes to monitor
  4. %procs = (
  5.     "urbanterror","start_server_ut",
  6.     "bloodfrontier","bfserver_linux",
  7.     "assaultcube","start_server_acube",
  8.     "teeworlds","teeworlds_srv",
  9.     "smokinguns","start_server_sg",
  10.     "worldofpadman","start_server_wop"
  11.     );
  12. $status = "lxgc.shackhost.net status:";
  13.  
  14. #Check monitored processes
  15. foreach $game (sort keys %procs)
  16. {
  17.     $counter++;
  18.     $proc_list = `ps ax`; #Not getting this each loop will cause $proc_list to get mangled by the regex
  19.     if ($proc_list =~ m/.*$procs{$game}.*/g)
  20.     {
  21.         $status = $status . " $game(ON)";
  22.         #print "$game is running($procs{$game})\n";
  23.     }
  24.     else
  25.     {
  26.         $status = $status . " $game(OFF)";
  27.         #print "$game is not running($procs{$game})\n";
  28.     }
  29. }
  30. print "$status";
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: