changing user within a post install.

Dennis Veatch dveatch at woh.rr.com
Thu Apr 1 18:19:58 GMT 2004


On Thursday 01 April 2004 06:07 pm, Chuck Mead wrote:
> Dennis Veatch wrote:
> | 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).
>
> iirc the -e means "exists and is a regular file"

Hmm, was looking in the manual and found "if" but it didn't say anything about 
those two.

Anyway, also don't really know the "proper" way to determine if it's 
installed. So figured anytime there's a "data" dir, postgres must have been 
initialized, so that's why I picked "-d". At the time didn't know about the 
"-e".

Really though, flying by the pant seats and plagiarizing the heck from other 
modules :)

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


More information about the Lunar-dev mailing list