Don't know how new database is run for user, do they go to a different directory, run a different file or both? Tell me the commands for the new database and I can change the script....
But you do something like this...
--------------------------
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
times=`who | grep -c "^$LOGNAME "`
if [ $times -gt 7 ]; then
echo "Sorry you have exceeded your 2 login limit."
echo "Exiting now..."
sleep 5
kill -9 $$
fi
$date
while true; do
echo "Please select the database you wish to use by pressing either the 1 or 2 button:"
echo "1) Database A and other description info....."
echo "2) Database B and other description info ....."
read -p "Please select database A or database B by pressing the 1 or 2 button and pressing enter. ->" DB
case $DB in
[1aA]* ) echo "You selected Database A! Starting....." ; cd /uv/cubs/dataabse; exec /uv/bin/uv;exit;;
# Old database commands separated with ; instead of new lines...
[2bB]* ) echo "You selected Database 2! Starting..."; cd /uv/cubs/dataabse2; exec /uv/bin/uv2;exit;;
# New database commands...
* ) echo "There are only two databases here... Please press either the 1 or the 2 button.";;
esac
done
Main Topics
Browse All Topics





by: KeremEPosted on 2009-09-14 at 18:38:33ID: 25330736
First of all these two lines disagree:
This will match 7+ occurences of the string
if [ $times -gt 7 ]; then
But this line displays it is over 2
echo "Sorry you have exceeded your 2 login limit."
Apart from that it does not seem to me that there's a parametric selection on which db to connect. It might be done by the
/uv/bin/uv
detecting the effective user. Can you tell how it is possible to send a parameter the the above mentioned program?
Waht are the accepted parameters?