Blame SOURCES/sapconf-check-resource-limit

e4ef47
diff -up sapconf-0.98/sapconf.resource-limit sapconf-0.98/sapconf
e4ef47
--- sapconf-0.98/sapconf.resource-limit	2017-09-11 14:56:55.457791517 +0200
e4ef47
+++ sapconf-0.98/sapconf	2017-09-11 16:34:34.116857953 +0200
e4ef47
@@ -387,6 +387,7 @@ fi #[ $ec -eq 0 ]
e4ef47
 function update_limits_conf() {
e4ef47
         local date olds oldval news newval LIMITS
e4ef47
         LIMITS=/etc/security/limits.d/99-sap-limits.conf
e4ef47
+        LIMITS_SAP_CONF=/etc/security/limits.d/99-sap.conf
e4ef47
         LIMITS_CONF=/etc/security/limits.conf
e4ef47
         date=`date -u +"%Y-%m-%d %H:%M:%S %Z"`
e4ef47
         newval=($1 $2 $3 $4)
e4ef47
@@ -398,6 +399,15 @@ function update_limits_conf() {
e4ef47
                 if [ "${oldval[3]}" != "${newval[3]}" ]; then
e4ef47
                         sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS_CONF"
e4ef47
                 fi
e4ef47
+        elif [ -e "$LIMITS_SAP_CONF" ] ; then
e4ef47
+                olds=`tac "$LIMITS_SAP_CONF" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`
e4ef47
+                if [ $? -eq 0 ] ; then # entry there, update
e4ef47
+                        oldval=($olds)
e4ef47
+                        if [ "${oldval[3]}" != "${newval[3]}" ]; then
e4ef47
+                                 sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS_SAP_CONF"
e4ef47
+                        fi
e4ef47
+                fi
e4ef47
+
e4ef47
         else
e4ef47
                 if [ -e "$LIMITS" ]; then
e4ef47
                         olds=`tac "$LIMITS" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`