|
|
@@ -3,6 +3,14 @@
|
|
|
## dbmail-setup.sh -- DBMail RDBMS Setup Utility
|
|
|
##
|
|
|
|
|
|
+# command line argument sanity check
|
|
|
+if [ $# -eq 0 ]; then
|
|
|
+ echo "$0:ERROR: invalid command line" 1>&2
|
|
|
+ echo "$0:USAGE: $0 install [<database-directory>]" 1>&2
|
|
|
+ echo "$0:USAGE: $0 uninstall" 1>&2
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
# package configuration
|
|
|
db_type="@db_type@"
|
|
|
db_script="@l_prefix@/share/dbmail/dbmail-setup.sql"
|
|
|
@@ -29,10 +37,15 @@ elif [ ".$db_type" = .pgsql ]; then
|
|
|
fi
|
|
|
|
|
|
# dispatch operation
|
|
|
-cmd="${1:-"install"}"
|
|
|
+cmd="$1"
|
|
|
+shift
|
|
|
case "$cmd" in
|
|
|
install )
|
|
|
# create the DBMail database
|
|
|
+ if [ $# -gt 0 ]; then
|
|
|
+ db_dir="$1"
|
|
|
+ shift
|
|
|
+ fi
|
|
|
if [ ".$db_type" = .sqlite ]; then
|
|
|
( umask 077
|
|
|
@l_prefix@/bin/sqlite3 $db_name <$db_script
|