X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=packaging%2Ffreebsd%2Fpkg-install;h=5e520cdfd20ad8a19f5b8f7c8e0dd1df39b0fb80;hb=5a8f2f1b6e5557ef8680bd1025239dcfd3f6550f;hp=92a4bbc759610ac78aeef2fd7a71d7f002d3ef2a;hpb=f197988f32461371452947cdfb310c8d9c367447;p=monkeysphere.git diff --git a/packaging/freebsd/pkg-install b/packaging/freebsd/pkg-install index 92a4bbc..5e520cd 100755 --- a/packaging/freebsd/pkg-install +++ b/packaging/freebsd/pkg-install @@ -22,8 +22,9 @@ POST-INSTALL) GROUP=${USER} UID=641 GID=${UID} + SHELL=/usr/local/bin/bash - if pw group show "${GROUP}" 2>/dev/null; then + if pw group show "${GROUP}" >/dev/null 2>&1; then echo "You already have a group \"${GROUP}\", so I will use it." else if pw groupadd ${GROUP} -g ${GID}; then @@ -34,11 +35,19 @@ POST-INSTALL) fi fi - if pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." + if pw user show "${USER}" >/dev/null 2>&1; then + oldshell=`pw user show "${USER}" 2>/dev/null | cut -f10 -d:` + if [ x"$oldshell" != x"$SHELL" ]; then + echo "You already have a \"${USER}\" user, but its shell is '$oldshell'." + echo "This package requires that \"${USER}\"'s shell be '$SHELL'." + echo "You should fix this by hand and then re-install the package." + echo " hint: pw usermod '$USER' -s '$SHELL'" + exit 1 + fi + echo "You already have a user \"${USER}\" with the proper shell, so I will use it." else if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "$VARLIB" -s /bin/sh -c "monkeysphere authentication user,,," + -d "$VARLIB" -s /usr/local/bin/bash -c "monkeysphere authentication user,,," then echo "Added user \"${USER}\"." else