Skip to content

Commit

Permalink
opensipsdbctl: allow running from root dir for _all_ SQL backends
Browse files Browse the repository at this point in the history
(cherry picked from commit 49ed85a)
(cherry picked from commit 9f316e2)
  • Loading branch information
liviuchircu committed Apr 1, 2015
1 parent fd0606a commit 270edb5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions scripts/opensipsdbctl
Expand Up @@ -26,6 +26,8 @@ fi
if [ $TEST = "true" ]; then
if [ -f ./opensipsctlrc ]; then
. ./opensipsctlrc
elif [ -f scripts/opensipsctlrc ]; then
. scripts/opensipsctlrc
fi
fi

Expand Down
4 changes: 3 additions & 1 deletion scripts/opensipsdbctl.db_berkeley
Expand Up @@ -112,8 +112,10 @@ fi ;

# path to the database schemas
DATA_DIR="/usr/local/share/opensips"
if [ -d "$DATA_DIR/db_berkeley/opensips" ] ; then
if [ -d "$DATA_DIR/db_berkeley/opensips" ]; then
DB_SCHEMA="$DATA_DIR/db_berkeley/opensips"
elif [ -d "scripts/db_berkeley/opensips" ]; then
DB_SCHEMA="scripts/db_berkeley/opensips"
else
DB_SCHEMA="./db_berkeley/opensips"
fi
Expand Down
4 changes: 3 additions & 1 deletion scripts/opensipsdbctl.dbtext
Expand Up @@ -11,8 +11,10 @@

# path to the database schemas
DATA_DIR="/usr/local/share/opensips"
if [ -d "$DATA_DIR/dbtext/opensips" ] ; then
if [ -d "$DATA_DIR/dbtext/opensips" ]; then
DB_SCHEMA="$DATA_DIR/dbtext/opensips"
elif [ -d "scripts/dbtext/opensips" ]; then
DB_SCHEMA="scripts/dbtext/opensips"
else
DB_SCHEMA="./dbtext/opensips"
fi
Expand Down
4 changes: 3 additions & 1 deletion scripts/opensipsdbctl.mysql
Expand Up @@ -18,8 +18,10 @@

# path to the database schemas
DATA_DIR="/usr/local/share/opensips"
if [ -d "$DATA_DIR/mysql" ] ; then
if [ -d "$DATA_DIR/mysql" ]; then
DB_SCHEMA="$DATA_DIR/mysql"
elif [ -d "scripts/mysql" ]; then
DB_SCHEMA="scripts/mysql"
else
DB_SCHEMA="./mysql"
fi
Expand Down
4 changes: 3 additions & 1 deletion scripts/opensipsdbctl.oracle
Expand Up @@ -13,8 +13,10 @@ DBSYSUSER="sys"

# path to the database schemas
DATA_DIR="/usr/local/share/opensips"
if [ -d "$DATA_DIR/oracle" ] ; then
if [ -d "$DATA_DIR/oracle" ]; then
DB_SCHEMA="$DATA_DIR/oracle"
elif [ -d "scripts/oracle" ]; then
DB_SCHEMA="scripts/oracle"
else
DB_SCHEMA="./oracle"
fi
Expand Down
4 changes: 3 additions & 1 deletion scripts/opensipsdbctl.pgsql
Expand Up @@ -30,8 +30,10 @@

# path to the database schemas
DATA_DIR="/usr/local/share/opensips"
if [ -d "$DATA_DIR/postgres" ] ; then
if [ -d "$DATA_DIR/postgres" ]; then
DB_SCHEMA="$DATA_DIR/postgres"
elif [ -d "scripts/postgres" ]; then
DB_SCHEMA="scripts/postgres"
else
DB_SCHEMA="./postgres"
fi
Expand Down

0 comments on commit 270edb5

Please sign in to comment.