Update default search engine for all users

This commit is contained in:
Bob Mottram 2017-09-23 12:17:16 +01:00
parent 8dd4a651a3
commit 391edfe243
1 changed files with 16 additions and 9 deletions

View File

@ -534,20 +534,27 @@ function install_dynamicdns {
mark_completed $FUNCNAME mark_completed $FUNCNAME
} }
function update_default_search_engine {
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
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
else
sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc
fi
fi
fi
done
}
function install_command_line_browser { function install_command_line_browser {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return return
fi fi
apt-get -yq install elinks apt-get -yq install elinks
update_default_search_engine
# set the home page
if ! grep -q "WWW_HOME" /home/$MY_USERNAME/.bashrc; then
if ! grep -q 'controluser' /home/$MY_USERNAME/.bashrc; then
echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$MY_USERNAME/.bashrc
else
sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$MY_USERNAME/.bashrc
fi
fi
mark_completed $FUNCNAME mark_completed $FUNCNAME
} }