Merge "Update sysctl-write-value to do conflict checking"

This commit is contained in:
Jenkins 2016-12-14 00:04:55 +00:00 committed by Gerrit Code Review
commit b34c5db441

View File

@ -26,7 +26,18 @@ fi
FILENAME="/etc/sysctl.d/${NAME}.conf"
if [ -f $FILENAME ]; then
# check to make sure the settings match... otherwise fail
if ! grep -q "^$NAME = $VALUE" $FILENAME; then
echo "Conflicting sysctl.conf setting for $NAME == $VALUE. Found:"
grep "^$NAME" $FILENAME
exit 1
fi
else
cat > $FILENAME <<EOF_CAT
# $COMMENT
$NAME = $VALUE
EOF_CAT
fi