]> git.pld-linux.org Git - packages/cacti-template-snmpdiskio.git/blame - bashism.patch
- drop obsolete and outdated manual inclusion of rpm macros
[packages/cacti-template-snmpdiskio.git] / bashism.patch
CommitLineData
00a441a6
ER
1--- cacti-template-snmpdiskio-0.9.6/snmpdiskio~ 2014-02-10 12:29:13.014370391 +0200
2+++ cacti-template-snmpdiskio-0.9.6/snmpdiskio 2014-02-10 12:29:45.033850913 +0200
ce7f765d
ER
3@@ -1,4 +1,4 @@
4-#!/bin/bash
5+#!/bin/sh
00a441a6 6 # $Id: snmpdiskio,v 1.3 2006/04/04 13:11:47 mikaelf Exp $
ce7f765d
ER
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.091683 seconds and 4 git commands to generate.