changing user within a post install.

Dennis Veatch dveatch at woh.rr.com
Thu Apr 1 17:53:07 GMT 2004


On Thursday 01 April 2004 05:35 pm, Jon South wrote:
> Dennis Veatch wrote:
> > Now I just need to add a bit of logic to detect /var/lib/pgsql/data
> > exists so as not to reinitialize the database if one already exists.
>
> if [ ! -e "/var/lib/pgsql/data" ]; then do_it; fi
>
> -Striker

Thanks. But I pulled this out of my rear :). At least I think it works;

if [ ! -d "/var/lib/pgsql/data" ]; then 
  su postgres -c '/usr/bin/initdb -D /var/lib/pgsql/data'
fi

Oh, wait that's what your saying. Duh.

I assume "-d" means directory and the "-e" (not sure).


-- 
Registered Linux user 193414
http://counter.li.org


More information about the Lunar-dev mailing list