Create and remove search engine users

This commit is contained in:
Bob Mottram 2016-03-05 18:43:01 +00:00
parent e87d8cc04b
commit 45e48526dc
3 changed files with 13 additions and 1 deletions

View File

@ -9364,7 +9364,7 @@ function install_search_engine {
SEARCH_ENGINE_PASSWORD="$(openssl rand -base64 16)"
fi
fi
echo "$SEARCH_ENGINE_PASSWORD" | htpasswd -i -d -c /etc/nginx/.htpasswd $MY_USERNAME
echo "$SEARCH_ENGINE_PASSWORD" | htpasswd -i -s -c /etc/nginx/.htpasswd $MY_USERNAME
echo '' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo $'Search Engine' >> /home/$MY_USERNAME/README

View File

@ -365,6 +365,12 @@ if grep -q "install_irc_client" $COMPLETION_FILE; then
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.irssi
fi
if [ -f /etc/nginx/.htpasswd ]; then
if ! grep "${MY_USERNAME}:" /etc/nginx/.htpasswd; then
echo "$NEW_USER_PASSWORD" | htpasswd -i -s /etc/nginx/.htpasswd $MY_USERNAME
fi
fi
# add user menu on ssh login
if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then
echo 'control' >> /home/$MY_USERNAME/.bashrc

View File

@ -104,6 +104,12 @@ if grep -q "GNU Social domain" $COMPLETION_FILE; then
fi
fi
if [ -f /etc/nginx/.htpasswd ]; then
if grep "${MY_USERNAME}:" /etc/nginx/.htpasswd; then
htpasswd -D /etc/nginx/.htpasswd $MY_USERNAME
fi
fi
#if grep -q "install_owncloud" $COMPLETION_FILE; then
# occ user:delete $MY_USERNAME
#fi