Update sysctl-write-value to do conflict checking
Adds conflict checking to the sysctl-write-value script to detect settings from multiple elements conflicting. Change-Id: If312d199388036d6f4103e94dca99249cb3bcbaf
This commit is contained in:
parent
fc7b7cf46d
commit
2e82d7f214
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue