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