#
# 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
#