summaryrefslogtreecommitdiffstats
path: root/plugins.d/fping.plugin
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 16:09:37 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 16:09:37 +0000
commit51f689a8e17ff3929acd2dbf39e936d2cd3ac723 (patch)
tree92e54f543171b69dcbc639be09d11221cf96ba28 /plugins.d/fping.plugin
parentNew upstream version 1.5.0+dfsg (diff)
downloadnetdata-51f689a8e17ff3929acd2dbf39e936d2cd3ac723.tar.xz
netdata-51f689a8e17ff3929acd2dbf39e936d2cd3ac723.zip
New upstream version 1.6.0+dfsgupstream/1.6.0+dfsg
Diffstat (limited to 'plugins.d/fping.plugin')
-rwxr-xr-xplugins.d/fping.plugin31
1 files changed, 25 insertions, 6 deletions
diff --git a/plugins.d/fping.plugin b/plugins.d/fping.plugin
index d523f4474..232c00630 100755
--- a/plugins.d/fping.plugin
+++ b/plugins.d/fping.plugin
@@ -22,20 +22,39 @@ if [ "${1}" = "install" ]
"${@}" || exit 1
}
+ download() {
+ local curl="$(which curl 2>/dev/null || command -v curl 2>/dev/null)"
+ [ ! -z "${curl}" ] && run curl -s -L "${1}" && return 0
+
+ local wget="$(which wget 2>/dev/null || command -v wget 2>/dev/null)"
+ [ ! -z "${wget}" ] && run wget -q -O - "${1}" && return 0
+
+ echo >&2 "Cannot find 'curl' or 'wget' in this system." && exit 1
+ }
+
[ ! -d /usr/src ] && run mkdir -p /usr/src
[ ! -d /usr/local/bin ] && run mkdir -p /usr/local/bin
run cd /usr/src
- if [ -d fping-ktsaou.git ]
+ if [ -d fping-3.15 ]
then
- run cd fping-ktsaou.git
- run git pull
- else
- run git clone https://github.com/ktsaou/fping.git fping-ktsaou.git
- run cd fping-ktsaou.git
+ run rm -rf fping-3.15 || exit 1
fi
+ download 'https://github.com/schweikert/fping/archive/3.15.tar.gz' | run tar -zxvpf -
+ [ $? -ne 0 ] && exit 1
+ run cd fping-3.15 || exit 1
+
+ #if [ -d fping-ktsaou.git ]
+ # then
+ # run cd fping-ktsaou.git
+ # run git pull
+ #else
+ # run git clone https://github.com/ktsaou/fping.git fping-ktsaou.git
+ # run cd fping-ktsaou.git
+ #fi
+
run ./autogen.sh
run ./configure --prefix=/usr/local
run make clean