Etherpad admin password

This commit is contained in:
Bob Mottram 2016-11-04 18:12:55 +00:00
parent e44f30e7ad
commit aa98819f9a
1 changed files with 8 additions and 21 deletions

View File

@ -53,20 +53,7 @@ etherpad_variables=(ETHERPAD_COMMIT
DDNS_PROVIDER
MY_USERNAME)
function get_mariadb_etherpad_admin_password {
if [ -f /home/$MY_USERNAME/README ]; then
if grep -q "MariaDB etherpad admin password" /home/$MY_USERNAME/README; then
ETHERPAD_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB etherpad admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
fi
if grep -q "etherpad administrator password" /home/$MY_USERNAME/README; then
ETHERPAD_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "etherpad administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//')
fi
fi
}
function etherpad_create_database {
function_check get_mariadb_etherpad_admin_password
get_mariadb_etherpad_admin_password
if [ ! $ETHERPAD_ADMIN_PASSWORD ]; then
if [ -f $IMAGE_PASSWORD_FILE ]; then
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
@ -441,6 +428,14 @@ function install_etherpad {
exit 7359
fi
if [ ! $ETHERPAD_ADMIN_PASSWORD ]; then
if [ -f $IMAGE_PASSWORD_FILE ]; then
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
else
ETHERPAD_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
fi
fi
function_check install_mariadb
install_mariadb
@ -481,14 +476,6 @@ function install_etherpad {
function_check add_ddns_domain
add_ddns_domain $ETHERPAD_DOMAIN_NAME
if [ ! $ETHERPAD_ADMIN_PASSWORD ]; then
if [ -f $IMAGE_PASSWORD_FILE ]; then
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
else
ETHERPAD_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
fi
fi
create_etherpad_settings
adduser --system --home=/var/www/$ETHERPAD_DOMAIN_NAME/htdocs/ --group etherpad