#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/firebird-tools-useradd - Firebird SQL Server add user # # Copyright (c) 2004 Jens Vehlhaber # # Creation: 2004-01-12 jv # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #----------------------------------------------------------------------------- #include eislib . /var/install/include/eislib export FIREBIRD='/usr/local/firebird' # check run firebird if [ -z "`ps -e | grep 'fbserver' | grep -v grep `" ] then mecho "" mecho -error "Firebird is not running" mecho "" anykey exit 1 fi clrhome # Read the ISC_PASSWORD only pw=`grep ISC_PASSWORD= ${FIREBIRD}/isc4.pw | sed "s/ISC_PASSWORD=//g"` # Add user mecho -info "Add Firebird user" mecho "" mecho -n "Enter username: " read NewName mecho "" mecho -n "Enter password: " stty -echo read NewPass stty echo mecho "" echo -n "Retype password: " stty -echo read RePass stty echo mecho "" if [ "$NewPass" != "$RePass" ] then mecho -error "Password input error" else mecho "" txtout=`${FIREBIRD}/bin/gsec -user SYSDBA -password $pw -add $NewName -pw $NewPass -lname $NewName 2>&1` if [ ! -z "$txtout" ] then mecho -error "Error! User not added." mecho "$txtout" mecho "" fi fi anykey #----------------------------------------------------------------------------- exit 0