Skip to content
Snippets Groups Projects
Commit 5293a3cd authored by Bob Mottram's avatar Bob Mottram
Browse files

Avoid duplicate bashrc entries

parent d7abf4dc
No related branches found
No related tags found
No related merge requests found
...@@ -540,9 +540,17 @@ function update_default_search_engine { ...@@ -540,9 +540,17 @@ function update_default_search_engine {
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
if ! grep -q "WWW_HOME" /home/$USERNAME/.bashrc; then if ! grep -q "WWW_HOME" /home/$USERNAME/.bashrc; then
if ! grep -q 'controluser' /home/$USERNAME/.bashrc; then if ! grep -q 'controluser' /home/$USERNAME/.bashrc; then
echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$USERNAME/.bashrc if ! grep -q 'export WWW_HOME=' /home/$USERNAME/.bashrc; then
echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$USERNAME/.bashrc
else
sed -i "s|export WWW_HOME=.*|export WWW_HOME=$DEFAULT_SEARCH|g" /home/$USERNAME/.bashrc
fi
else else
sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc if ! grep -q 'export WWW_HOME=' /home/$USERNAME/.bashrc; then
sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc
else
sed -i "s|export WWW_HOME=.*|export WWW_HOME=$DEFAULT_SEARCH|g" /home/$USERNAME/.bashrc
fi
fi fi
fi fi
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment