Skip to content

Commit ab6ed39

Browse files
committed
Move one more 'grep' to condition in scriptlets
Do 'if grep SOMETHING SOMEWHERE' instead of just running grep and then checking $?. Ticket: ENT-3385 Changelog: None
1 parent 4c66e90 commit ab6ed39

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packaging/common/cfengine-hub/preremove.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@ case "`package_type`" in
3939
;;
4040
esac
4141

42-
if [ -f "$MAN_CONFIG" ]; then
43-
grep -q cfengine "$MAN_CONFIG"
44-
if [ $? = "0" ]; then
45-
sed -i '/cfengine/d' "$MAN_CONFIG"
46-
fi
42+
if [ -f "$MAN_CONFIG" ] && grep -q cfengine "$MAN_CONFIG"; then
43+
sed -i '/cfengine/d' "$MAN_CONFIG"
4744
fi
4845

4946
#

0 commit comments

Comments
 (0)