Commit 06090cb5 authored by Jason Moss's avatar Jason Moss
Browse files

Update sed command to account for commented lines in configuration files.

parent b76e52af
......@@ -39,7 +39,10 @@ else
if grep -Fq $KEY $CONFIG_FILE; then
# Replace existing configuration line
echo -e "\tOLD value :" $(cat $CONFIG_FILE | grep $KEY)
sed -i "s@^$KEY=.*@$REPLACE@g" $CONFIG_FILE
#sed -i "s@^$KEY=.*@$REPLACE@g" $CONFIG_FILE
#previous sed command did not match when the line started with a hashtag
# # CONFIG_xxx is not set
sed -i.orig -E "s@^(# |)$KEY.*@$REPLACE@g" $CONFIG_FILE
echo -e "\tNEW value :" $(cat $CONFIG_FILE | grep $KEY)
# Add new string
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment