aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--numnodes.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/numnodes.sh b/numnodes.sh
index 8907720..29858b1 100644
--- a/numnodes.sh
+++ b/numnodes.sh
@@ -4,11 +4,17 @@
#echo -n "online nodes: "
num=$(wget http://127.0.0.1:4000/metrics -qO - | grep meshnodes_online_total|cut -d ' ' -f2) 2> /dev/null
-if test "$num" -ge 1; then
-
- num="$(expr $num - 4)"
- cd "$(dirname "$0")"
-
- sed 's/<NUM_NODES>/'"$num"'/g' numnodes.template > _site/numnodes.html
-
-fi
+case $num in
+ ''|*[!0-9]*) echo "bad number: >>$num<<" ;;
+ *)
+ if test "$num" -ge 1; then
+
+ num="$(expr $num - 4)"
+ cd "$(dirname "$0")"
+
+ sed 's/<NUM_NODES>/'"$num"'/g' numnodes.template > _site/numnodes.html
+
+ fi
+ ;;
+esac
+# vim: syntax=bash ts=4 sw=4 sts=4 sr noet