#! /bin/bash # Script to create database 'opensim' in mysql if it does not exist. # Someone has set the environment variables before running this. # Needs: # MYSQL_ROOT_PASSWORD # OPENSIM_DB_PASSWORD OPENSIMBIN=${OPENSIMBIN:-/home/opensim/opensim/bin} OPENSIMCONFIG=${OPENSIMCONFIG:-$OPENSIMBIN/config} cd "$OPENSIMCONFIG" if [[ ! -z "$MYSQL_ROOT_PASSWORD" ]] ; then SQLCMDS=${OPENSIMCONFIG}/mymy$$ SQLOPTIONS=${OPENSIMCONFIG}/mymyoptions$$ rm -f "$SQLCMDS" rm -f "$SQLOPTIONS" cat > "$SQLCMDS" < "$SQLOPTIONS" <