From 6cb4c15123c7acfda25ebf517ade8bc0048f5bf9 Mon Sep 17 00:00:00 2001 From: sobomax Date: Mon, 28 Jan 2002 17:50:11 +0000 Subject: Fix installation when /usr/sbin not in the PATH. PR: 34289 Submitted by: Joe Marcus Clarke --- x11/gdm/pkg-install | 9 +++++---- x11/gdm2/pkg-install | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'x11') diff --git a/x11/gdm/pkg-install b/x11/gdm/pkg-install index 23dd7d7a68c..56e5a86af3e 100644 --- a/x11/gdm/pkg-install +++ b/x11/gdm/pkg-install @@ -9,11 +9,12 @@ if [ "$2" = "POST-INSTALL" ]; then GROUP=${USER} UID=91 GID=${UID} + PW=/usr/sbin/pw - if pw group show "${GROUP}" 2>/dev/null; then + if ${PW} group show "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." else - if pw groupadd ${GROUP} -g ${GID}; then + if ${PW} groupadd ${GROUP} -g ${GID}; then echo "Added group \"${GROUP}\"." else echo "Adding group \"${GROUP}\" failed..." @@ -21,10 +22,10 @@ if [ "$2" = "POST-INSTALL" ]; then fi fi - if pw user show "${USER}" 2>/dev/null; then + if ${PW} user show "${USER}" 2>/dev/null; then echo "You already have a user \"${USER}\", so I will use it." else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ -d "/nonexistent" -s /sbin/nologin -c "GNOME Display Manager" then echo "Added user \"${USER}\"." diff --git a/x11/gdm2/pkg-install b/x11/gdm2/pkg-install index 23dd7d7a68c..56e5a86af3e 100644 --- a/x11/gdm2/pkg-install +++ b/x11/gdm2/pkg-install @@ -9,11 +9,12 @@ if [ "$2" = "POST-INSTALL" ]; then GROUP=${USER} UID=91 GID=${UID} + PW=/usr/sbin/pw - if pw group show "${GROUP}" 2>/dev/null; then + if ${PW} group show "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." else - if pw groupadd ${GROUP} -g ${GID}; then + if ${PW} groupadd ${GROUP} -g ${GID}; then echo "Added group \"${GROUP}\"." else echo "Adding group \"${GROUP}\" failed..." @@ -21,10 +22,10 @@ if [ "$2" = "POST-INSTALL" ]; then fi fi - if pw user show "${USER}" 2>/dev/null; then + if ${PW} user show "${USER}" 2>/dev/null; then echo "You already have a user \"${USER}\", so I will use it." else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ -d "/nonexistent" -s /sbin/nologin -c "GNOME Display Manager" then echo "Added user \"${USER}\"." -- cgit