File: avoided.php

package info (click to toggle)
netmrg 0.18.2-14
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,104 kB
  • ctags: 1,575
  • sloc: xml: 8,912; php: 7,389; sh: 4,019; cpp: 2,581; perl: 471; ansic: 338; makefile: 316; sql: 5
file content (28 lines) | stat: -rwxr-xr-x 547 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/php -q
<?
mysql_connect("localhost", "netmrgread", "netmrgread")
        or die("ERROR: cannot connect to server\n");
mysql_select_db("netmrg")
        or die("ERROR: cannot connect to database\n");

$dev_id = $argv[1];

$stat_query = "SELECT avoided FROM mon_devices WHERE id = $dev_id";
$stat_result = mysql_query($stat_query) or 
        die("ERROR: cannot perform query\n$stat_query\n\n");

$stat = mysql_fetch_array($stat_result);

if ($stat["avoided"] != "") {
echo "{$stat["avoided"]}\n";
} else {
echo "1\n";
}

exit();





?>