summaryrefslogtreecommitdiff
path: root/net/nagios-plugin-mysql/patches/patch-am
blob: 495de47227e95df28b5bda4990b5f75c02be6398 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$NetBSD: patch-am,v 1.1 2006/10/16 08:40:45 seb Exp $

--- contrib/check_mssql.sh.orig	2003-08-05 09:56:13.000000000 +0000
+++ contrib/check_mssql.sh
@@ -35,10 +35,10 @@ pswd=$3
 srv=$4
 
 
-if [ ! "$#" == "4" ]; then
+if [ ! "$#" = "4" ]; then
         echo -e "\nYou did not supply enough arguments. \nUsage: $0 <host> <username> <password> <version> \n \n$0 checks Microsoft SQL Server connectivity. It works with versions 7 and 2000.\n\nYou need a working version of FreeTDS (http://www.freetds.org/) and tsql (included in FreeTDS 6.0+) to connect to the SQL server. \nIt was written by Tom De Blende (tom.deblende@village.uunet.be) in 2003. \n\nExample:\n $0 dbserver sa f00bar 2000\n" && exit "3"
 
-elif [ $tsqlcmd == "" ]; then
+elif [ $tsqlcmd = "" ]; then
 	echo -e "tsql not found! Please verify you have a working version of tsql (included in the FreeTDS version 6.0+) and enter the full path in the script." && exit "3"
 
 fi
@@ -50,9 +50,9 @@ exit="3"
 
 tmpfile=`$mktempcmd /tmp/$hostname.XXXXXX`
 
-if [ $srv == "7" ]; then
+if [ $srv = "7" ]; then
         spid=7
-elif [ $srv == "2000" ]; then
+elif [ $srv = "2000" ]; then
         spid=50
 else
 	echo -e "$srv is not a supported MS SQL Server version!" && exit "3"
@@ -69,7 +69,7 @@ $tsqlcmd -S $hostname -U $usr -P $pswd <
 
 $grepcmd -q "Login failed for user" $errorfile
 
-if [ "$?" == "0" ]; then
+if [ "$?" = "0" ]; then
 	$rmcmd -f $tmpfile $resultfile $errorfile;
         echo CRITICAL - Could not make connection to SQL server. Login failed.;
         exit 2;
@@ -77,7 +77,7 @@ fi
 
 $grepcmd -q "There was a problem connecting to the server" $errorfile
 
-if [ "$?" == "0" ]; then
+if [ "$?" = "0" ]; then
         $rmcmd -f $tmpfile $resultfile $errorfile;
         echo CRITICAL - Could not make connection to SQL server. Incorrect server name or SQL service not running.;
         exit 2;
@@ -85,7 +85,7 @@ fi
 
 resultfileln=`$catcmd $resultfile | $wccmd -l | $sedcmd 's/  //g'`
 
-if [ "$resultfileln" == "2" ]; then
+if [ "$resultfileln" = "2" ]; then
 	$rmcmd -f $tmpfile $resultfile $errorfile;
         echo CRITICAL - Could not make connection to SQL server. No data received from host.;
         exit 2;