mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-23 08:32:42 +00:00
7f9af98456
git-svn-id: http://svn.osgeo.org/postgis/trunk@2373 b70326c6-7e19-0410-871a-916f4a2858ee
32 lines
859 B
Bash
32 lines
859 B
Bash
#!/bin/sh
|
|
|
|
# create a database using the given template
|
|
# other parameters are passed to createdb,
|
|
# but the specified owner will not have
|
|
# extra privileges on objects in the template. see createdb.postgis(1)
|
|
|
|
source @bindir@/postgis_env.sh
|
|
|
|
for ARGVN in $1 $2 ; do
|
|
if [ `expr substr $ARGVN 1 11` = "--template=" ]; then
|
|
TDB=`echo $ARGVN | sed -e s/^--template=//`
|
|
elif [ `expr substr $ARGVN 1 6` = "--help" ]; then
|
|
echo "Usage of `basename $0`"
|
|
echo "Supply arguments as follows"
|
|
echo "--template=templatename of the template to use"
|
|
echo "Other arguments will be passed verbatim to createdb,"
|
|
echo "and it may return additional messages."
|
|
echo "You must usually have createdb privileges"
|
|
echo "in order to use `basename $0`"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
PWD1=`pwd`
|
|
|
|
cd /tmp
|
|
|
|
exec createdb -T $TDB "$@"
|
|
|
|
cd $PWD1
|