Work around portal storing passwords in local fs space on deleuze
authorclinton_admin <clinton_admin@fritz.hcoop.net>
Mon, 6 Aug 2012 17:50:27 +0000 (13:50 -0400)
committerclinton_admin <clinton_admin@fritz.hcoop.net>
Mon, 6 Aug 2012 17:50:27 +0000 (13:50 -0400)
* Really need to move these to afs

new-user

index cef1f60..48ca9ab 100755 (executable)
--- a/new-user
+++ b/new-user
@@ -37,18 +37,19 @@ ssh -K fritz.hcoop.net  /afs/hcoop.net/common/etc/scripts/create-user $USERNM ||
 #
 # Now set the password
 #
-#if ! test -r "$PWFILE"; then
-#      echo "Skipping password set from $PWFILE (doesn't exist or permission denied)"
-#      #exit 4
-#else
-#      echo Setting password from $PWFILE
-#      sudo sh -c "cat $PWFILE | tee -| /afs/hcoop.net/common/etc/scripts/change-user-password $USERNM" || \
-#      ( echo "cat $PWFILE | tee - | change-user-password $USERNM failed" && exit 5 )
+if ! test -r "$PWFILE"; then
+       echo "Skipping password set from $PWFILE (doesn't exist or permission denied)"
+       #exit 4
+else
+       echo Setting password from $PWFILE
+       actual_user=`whoami`
+       sudo sh -c "cat $PWFILE | tee -| ssh -K ${actual_user}@fritz.hcoop.net /afs/hcoop.net/common/etc/scripts/change-user-password $USERNM" || \
+       ( echo "cat $PWFILE | tee - | change-user-password $USERNM failed" && exit 5 )
 
        # Delete password file
        #sudo rm -- "$PWFILE"
 #      echo "Not deleting $PWFILE. Enable it in the script when you want"
-#fi
+fi
 
 
 #