new-user: Expand ~$USERNM correctly
authormwolson_admin <mwolson_admin@deleuze.hcoop.net>
Wed, 12 Dec 2007 17:19:09 +0000 (12:19 -0500)
committermwolson_admin <mwolson_admin@deleuze.hcoop.net>
Wed, 12 Dec 2007 17:19:09 +0000 (12:19 -0500)
new-user

index 8f015ed..345f105 100755 (executable)
--- a/new-user
+++ b/new-user
@@ -58,9 +58,10 @@ if test -z "$EMAILADDR"; then
        echo "Skipping email forwarding, no email address was specified."
 else
        echo setting email forward to "$EMAILADDR"
-       sh -c "echo '$EMAILADDR' > ~$USERNM/.public/.forward" || \
+       FORWARD_PATH=$(sh -c "echo ~$USERNM/.public/.forward")
+       echo "$EMAILADDR" > $FORWARD_PATH || \
        ( echo "Failed to set forward address" && exit 6 )
-       chown $USERNM ~$USERNM/.public/.forward
+       chown $USERNM $FORWARD_PATH
 fi
 
 #