Skip to content
Snippets Groups Projects
reset-display-settings.sh 523 B
Newer Older
  • Learn to ignore specific revisions
  • tpylak's avatar
    tpylak committed
    #!/bin/bash
    # Use with care!
    # Overrides all user display settings with the settings of the template user.
    
    
    tpylak's avatar
    tpylak committed
    echo Remove 'exit' after configuring existing user name, currently it is $TEMPLATE_USER
    
    tpylak's avatar
    tpylak committed
    exit 1
    
    tpylak's avatar
    tpylak committed
    TEMPLATE_USER=openbis-user-name
    
    
    tpylak's avatar
    tpylak committed
    BASE=`dirname "$0"`
    if [ ${BASE#/} == ${BASE} ]; then
        BASE="`pwd`/${BASE}"
    fi
    
    source $BASE/env
    
    
    tpylak's avatar
    tpylak committed
    psql -U $DB_USER_NAME -d $OPENBIS_DB -c "update persons set display_settings = (select display_settings from persons where user_id = '$TEMPLATE_USER') where user_id != '$TEMPLATE_USER'"