]> git.pld-linux.org Git - packages/cacti-template-snmpdiskio.git/blame - bashism.patch
- do not put exported templates to script_queries dir
[packages/cacti-template-snmpdiskio.git] / bashism.patch
CommitLineData
ce7f765d
ER
1--- snmpdiskio-0.9.4/snmpdiskio~ 2006-04-04 16:19:35.000000000 +0300
2+++ snmpdiskio-0.9.4/snmpdiskio 2008-10-05 15:54:02.460131923 +0300
3@@ -1,4 +1,4 @@
4-#!/bin/bash
5+#!/bin/sh
6 # $Id$
7 # snmpdiskio v0.9.4 (c) 2006 Mikael Fridh <mikael@meanstreak.se>
8
9@@ -13,17 +13,17 @@
10 fi
11
12
13-function hdNum()
14+hdNum()
15 {
16 awk ' BEGIN { num=0 } $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { num++ } END { print num } ' $PROCFILE
17 }
18
19-function hdIndex()
20+hdIndex()
21 {
22 awk ' BEGIN { num=0 } $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { num++; print num } ' $PROCFILE
23 }
24
25-function hdDescr()
26+hdDescr()
27 {
28 if [ "$MODE" = "linux26" ]; then
29 awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { printf "%s\n", $3 }' $PROCFILE
30@@ -32,19 +32,19 @@
31 fi
32 }
33
34-function hdInBlocks()
35+hdInBlocks()
36 {
37 awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $10 ~ /[0-9]+/ { printf "%.0f\n", $10 * 512 }
38 $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $10 !~ /[0-9]+/ { printf "%.0f\n", $5 * 512 } ' $PROCFILE
39 }
40
41-function hdOutBlocks()
42+hdOutBlocks()
43 {
44 awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $8 ~ /[0-9]+/ { printf "%.0f\n", $8 * 512 }
45 $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $8 !~ /[0-9]+/ { printf "%.0f\n", $7 * 512 } ' $PROCFILE
46 }
47
48-function usage()
49+usage()
50 {
51 cat <<-EOUSAGE
52 Usage: $0 <hdNum|hdIndex|hdDescr|hdInBlocks|hdOutBlocks>
This page took 0.102613 seconds and 4 git commands to generate.