wok-current diff postgresql/receipt @ rev 18730
Quote root dir in post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 20 15:13:45 2015 +0100 (2015-12-20) |
parents | 51a1ebbda768 |
children | fa0020fd543d |
line diff
1.1 --- a/postgresql/receipt Fri Oct 18 19:43:55 2013 +0000 1.2 +++ b/postgresql/receipt Sun Dec 20 15:13:45 2015 +0100 1.3 @@ -56,20 +56,20 @@ 1.4 post_install() 1.5 { 1.6 # adduser postgres if needed 1.7 - if ! grep -q postgres: $1/etc/passwd; then 1.8 + if ! grep -q postgres: "$1/etc/passwd"; then 1.9 echo -n "Adding user postgres..." 1.10 - chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql 1.11 - #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/* 1.12 + chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql 1.13 + #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/* 1.14 status 1.15 fi 1.16 # addgroup postgres if needed 1.17 - if ! grep -q postgres: $1/etc/group; then 1.18 + if ! grep -q postgres: "$1/etc/group"; then 1.19 echo -n "Adding group postgres..." 1.20 - chroot $1/ sh -c 'addgroup -g 88 postgres' 1.21 + chroot "$1/" sh -c 'addgroup -g 88 postgres' 1.22 status 1.23 fi 1.24 - [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql 1.25 - chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql 1.26 + [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql" 1.27 + chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql 1.28 cat <<EOF 1.29 ---- 1.30 postgres has superuser access. 1.31 @@ -87,5 +87,5 @@ 1.32 { 1.33 # when both user and group have the same id# and name 1.34 # both group and user will get removed with either delusr/delgroup 1.35 - chroot $1/ deluser postgres 1.36 + chroot "$1/" deluser postgres 1.37 }