Browse Source

converted spaces back to tabs

/\/\ \-/ ❭❬ 5 years ago
parent
commit
abde797e19
1 changed files with 65 additions and 65 deletions
  1. 65
    65
      check.sh

+ 65
- 65
check.sh View File

@@ -120,7 +120,7 @@ TC_INIT() {
120 120
 }
121 121
 
122 122
 TC_END() {
123
-	
123
+
124 124
 	if [ "$tc_fail" -gt 0 ]
125 125
 	then
126 126
 		if [ "$verbose" -gt 1 ]
@@ -269,10 +269,10 @@ check_html_title() {
269 269
 	echo '<?xml version="1.0"?>
270 270
 <xsl:stylesheet version="1.0"
271 271
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
272
-        <xsl:output method = "text"/>
273
-        <xsl:template match="/">
274
-                <xsl:value-of select="/html/head/title"/>
275
-        </xsl:template>
272
+		<xsl:output method = "text"/>
273
+		<xsl:template match="/">
274
+				<xsl:value-of select="/html/head/title"/>
275
+		</xsl:template>
276 276
 </xsl:stylesheet>' > $tmpxsl
277 277
 
278 278
 	tmphtml=$(mktemp -t html.XXXXXXXXX)
@@ -298,57 +298,57 @@ check_audiostream() {
298 298
 	# Uses mplayer to fetch 128Kb of stream
299 299
 	# $1 Stream URL
300 300
 	# $2 size
301
-    MPLAYER=$(whereis mplayer|cut -d' ' -f2)
302
-    MPV=$(whereis mpv|cut -d' ' -f2)
303
-    if [ -x $MPLAYER ]
304
-    then
305
-        tmpfile=$(mktemp -t check_audiostream.XXXXXXXXX)
306
-        
307
-        sz="$2"
308
-        if [ -z "$sz" ]
309
-        then
310
-            sz="128kb"
311
-        fi
312
-        if [ "$verbose" -gt 1 ]
313
-        then
314
-            logdate INFO "$tc_name: Running mplayer on '$1' for $sz" 3
315
-        fi
316
-
317
-        $MPLAYER -endpos $sz -ao pcm:file=$tmpfile "$1" 1>/dev/null 2>/dev/null
318
-        res=$?
319
-        bytes=$(du $tmpfile | cut -f1)
320
-        rm $tmpfile 2>/dev/null
321
-
322
-        if [ "$bytes" -lt 1024 ]
323
-        then
324
-            fail "mplayer retrieved ${bytes}B of stream instead of expected $sz"
325
-            return
326
-        fi
327
-        if [ "$res" -eq 0 ]
328
-        then
329
-            success "mplayer retrieved $sz of stream on $1"
330
-        else
331
-            fail "mplayer failed to retrieve stream on $1"
332
-        fi
333
-    elif [ -x $MPV ]
334
-    then
335
-        if [ "$verbose" -gt 1 ]
336
-        then
337
-            logdate INFO "$tc_name: Running mpv on '$1' for $sz" 3
338
-        fi
339
-        tmpfile=$(mktemp -t check_audiostream.XXXXXXXXX)
340
-        $MPV --vo=null --ao=null --o=$tmpfile --of=wav --length 1 "$1" &> /dev/null
341
-        bytes=$(du $tmpfile | cut -f1)
342
-        rm $tmpfile 2>/dev/null
343
-
344
-        if [ "$bytes" -ge 1 ]
345
-        then
346
-            success "mpv read successfully $1"
347
-        else
348
-            fail "mpv could not read $1"
349
-        fi
350
-
351
-    fi
301
+	MPLAYER=$(whereis mplayer|cut -d' ' -f2)
302
+	MPV=$(whereis mpv|cut -d' ' -f2)
303
+	if [ -x $MPLAYER ]
304
+	then
305
+		tmpfile=$(mktemp -t check_audiostream.XXXXXXXXX)
306
+		
307
+		sz="$2"
308
+		if [ -z "$sz" ]
309
+		then
310
+			sz="128kb"
311
+		fi
312
+		if [ "$verbose" -gt 1 ]
313
+		then
314
+			logdate INFO "$tc_name: Running mplayer on '$1' for $sz" 3
315
+		fi
316
+
317
+		$MPLAYER -endpos $sz -ao pcm:file=$tmpfile "$1" 1>/dev/null 2>/dev/null
318
+		res=$?
319
+		bytes=$(du $tmpfile | cut -f1)
320
+		rm $tmpfile 2>/dev/null
321
+
322
+		if [ "$bytes" -lt 1024 ]
323
+		then
324
+			fail "mplayer retrieved ${bytes}B of stream instead of expected $sz"
325
+			return
326
+		fi
327
+		if [ "$res" -eq 0 ]
328
+		then
329
+			success "mplayer retrieved $sz of stream on $1"
330
+		else
331
+			fail "mplayer failed to retrieve stream on $1"
332
+		fi
333
+	elif [ -x $MPV ]
334
+	then
335
+		if [ "$verbose" -gt 1 ]
336
+		then
337
+			logdate INFO "$tc_name: Running mpv on '$1' for $sz" 3
338
+		fi
339
+		tmpfile=$(mktemp -t check_audiostream.XXXXXXXXX)
340
+		$MPV --vo=null --ao=null --o=$tmpfile --of=wav --length 1 "$1" &> /dev/null
341
+		bytes=$(du $tmpfile | cut -f1)
342
+		rm $tmpfile 2>/dev/null
343
+
344
+		if [ "$bytes" -ge 1 ]
345
+		then
346
+			success "mpv read successfully $1"
347
+		else
348
+			fail "mpv could not read $1"
349
+		fi
350
+
351
+	fi
352 352
 }
353 353
 
354 354
 check_ping() {
@@ -580,9 +580,9 @@ check_ssh_key() {
580 580
 }
581 581
 
582 582
 check_mpc() {
583
-    # check_mpc [$host [$port] ]
584
-    # tests if you can contact an MPD server in a client way
585
-    # returns the current state of the server
583
+	# check_mpc [$host [$port] ]
584
+	# tests if you can contact an MPD server in a client way
585
+	# returns the current state of the server
586 586
 
587 587
 	host=$1
588 588
 	port=$2
@@ -597,10 +597,10 @@ check_mpc() {
597 597
 		port=6600
598 598
 	fi
599 599
 
600
-    if echo "status" | nc -w 1 "$host" "$port" | head -1 | grep "^OK MPD"
601
-    then
602
-        success "MPD server can be contacted on $host:$port"
603
-        status=$(echo "status" | nc -w 1 "$host" "$port" | grep "^state:"|cut -d: -f2)
604
-        success "It's state is : $status"
605
-    fi
600
+	if echo "status" | nc -w 1 "$host" "$port" | head -1 | grep "^OK MPD"
601
+	then
602
+		success "MPD server can be contacted on $host:$port"
603
+		status=$(echo "status" | nc -w 1 "$host" "$port" | grep "^state:"|cut -d: -f2)
604
+		success "It's state is : $status"
605
+	fi
606 606
 }

Loading…
Cancel
Save