mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 09:02:37 +00:00
7f9af98456
git-svn-id: http://svn.osgeo.org/postgis/trunk@2373 b70326c6-7e19-0410-871a-916f4a2858ee
30 lines
850 B
Bash
30 lines
850 B
Bash
#!/bin/sh
|
|
|
|
#drop template_gis
|
|
#it may be used to drop any postgresql template, by supplying argument
|
|
|
|
source @bindir@/postgis_env.sh
|
|
|
|
for ARGVN in $1 $2 $3 $4 ; do
|
|
if [ `expr substr $ARGVN 1 11` = "--template=" ]; then
|
|
TDB=`echo $ARGVN | sed -e s/^--template=//`
|
|
elif [ `expr substr $ARGVN 1 6` = "--dba=" ]; then
|
|
DBAUSER=`echo $ARGVN | sed -e s/^--dba=//`
|
|
elif [ -n $ARGVN ]; then
|
|
echo "Usage of `basename $0`"
|
|
echo "Supply arguments as follows"
|
|
echo "--template=templatename of the template to remove"
|
|
echo "--dba=dbaname of the dba to run administrational programs as"
|
|
echo "You must usually be either root, or a postgresql dba in order"
|
|
echo "to use `basename $0`"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
source @bindir@/postgres_lib.sh
|
|
|
|
sudo_dba $DBAUSER
|
|
|
|
export DBAUSER TDB
|
|
$SUDO -c "@bindir@/rmtemplate_gis.sh"
|