1From ffc8ba8d324243a923abe48e9758adecb03d24a4 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Tue, 12 Feb 2019 21:25:23 +0100
4Subject: [PATCH] atop.daily, atop.init, atop-pm.sh: Avoid using bash
5
6Avoid using bash and bashisms when not necesary. On some systems,
7e.g., embedded products, bash may not be available by default.
8
9Upstream-Status: Submitted [https://github.com/Atoptool/atop/pull/50]
10Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
11---
12 atop-pm.sh | 2 +-
13 atop.daily | 4 ++--
14 atop.init  | 4 ++--
15 3 files changed, 5 insertions(+), 5 deletions(-)
16
17diff --git a/atop-pm.sh b/atop-pm.sh
18index 7f41a86..3ff4ab5 100755
19--- a/atop-pm.sh
20+++ b/atop-pm.sh
21@@ -1,4 +1,4 @@
22-#!/bin/bash
23+#!/bin/sh
24
25 case "$1" in
26 	pre)	/usr/bin/systemctl stop atop
27diff --git a/atop.daily b/atop.daily
28index 57a9507..fe5a11b 100755
29--- a/atop.daily
30+++ b/atop.daily
31@@ -1,4 +1,4 @@
32-#!/bin/bash
33+#!/bin/sh
34
35 LOGOPTS="-R"				# default options
36 LOGINTERVAL=600				# default interval in seconds
37@@ -38,7 +38,7 @@ then
38
39 	while ps -p `cat "$PIDFILE"` > /dev/null
40 	do
41-		let CNT+=1
42+		CNT=$((CNT + 1))
43
44 		if [ $CNT -gt 5 ]
45 		then
46diff --git a/atop.init b/atop.init
47index e6e11dc..03c3f02 100755
48--- a/atop.init
49+++ b/atop.init
50@@ -1,4 +1,4 @@
51-#!/bin/bash
52+#!/bin/sh
53 #
54 # atop		Startup script for the Atop process logging in background
55 #
56@@ -47,7 +47,7 @@ case "$1" in
57
58 		while ps -p `cat $PIDFILE` > /dev/null
59 		do
60-			let CNT+=1
61+			CNT=$((CNT + 1))
62
63 			if [ $CNT -gt 5 ]
64 			then
65--
662.12.0
67
68