#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/firebird-tools-userpass - change Admin and User password # # Copyright (c) 2004 Jens Vehlhaber # # Creation: 2004-01-05 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"` mecho -info "Change Firebird user password" mecho "" mecho -n "Enter username: " read user_input if [ -z "$user_input" ] then mecho -warn "No username. Input abortet." exit 1 fi user_name=`echo $user_input | tr [:lower:] [:upper:]` mecho "" mecho -n "Enter new password:" stty -echo read NewPass stty echo mecho "" mecho -n "Retype new password:" stty -echo read RePass stty echo mecho "" mecho "" if [ $NewPass != $RePass ] then mecho -error "Password input error" else txtout=`${FIREBIRD}/bin/gsec -user SYSDBA -password $pw -modify $user_name -pw $NewPass 2>&1` txtout=`echo $txtout | sed "s/Warning - maximum 8 significant bytes of password used//g"` if [ ! -z "$txtout" ] then mecho -error "Error! Password not changed." mecho "$txtout" mecho "" else if [ "$user_name" = "SYSDBA" ] then echo "ISC_PASSWORD=$NewPass" > ${FIREBIRD}/isc4.pw chmod 0600 ${FIREBIRD}/isc4.pw fi fi fi anykey #----------------------------------------------------------------------------- exit 0