Adding and removing users

This commit is contained in:
Bob Mottram 2016-12-23 16:11:57 +00:00
parent 9c07b17bb4
commit dba12100ac
1 changed files with 8 additions and 1 deletions

View File

@ -66,10 +66,17 @@ function change_password_mediagoblin {
function add_user_mediagoblin {
new_username="$1"
new_user_password="$2"
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg adduser --username $new_username --password $new_username $new_user_password" - mediagoblin
echo "0"
}
function remove_user_mediagoblin {
remove_username="$1"
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg deluser --username $new_username" - mediagoblin
echo "0"
}
function reconfigure_mediagoblin {
@ -370,7 +377,7 @@ function install_mediagoblin {
systemctl start mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg dbupdate" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg adduser --username $MY_USERNAME --password admin $MEDIAGOBLIN_ADMIN_PASSWORD" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg adduser --username $MY_USERNAME --password $MY_USERNAME $MEDIAGOBLIN_ADMIN_PASSWORD" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg makeadmin $MY_USERNAME" - mediagoblin
function_check create_site_certificate