Avoid duplicate bashrc entries
This commit is contained in:
parent
d7abf4dc06
commit
5293a3cdf2
|
@ -540,9 +540,17 @@ function update_default_search_engine {
|
|||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if ! grep -q "WWW_HOME" /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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue