scripts/make-account-for-fyodor-user: Update to latest version
authorbigmike160 <bigmike160>
Wed, 29 Aug 2007 18:52:40 +0000 (18:52 +0000)
committerbigmike160 <bigmike160>
Wed, 29 Aug 2007 18:52:40 +0000 (18:52 +0000)
make-account-for-fyodor-user

index 7def42c..4cd370e 100755 (executable)
@@ -9,11 +9,17 @@ for USERHOME in `ssh $ADMIN@fyodor.hcoop.net cd /home\; find */.mire-password -s
   PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
 
   echo == creating user $USER ======================================================================
   PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
 
   echo == creating user $USER ======================================================================
+    echo ssh $ADMIN@fyodor.hcoop.net "cat /home/$USER/.mire-password"
+    ssh $ADMIN@fyodor.hcoop.net "cat /home/$USER/.mire-password" || \
+     (echo == sending complaint to $USER@hcoop.net ====================================================;\
+      echo 'please have a fyodor admin fix it (Adam Megacz is not a fyodor admin)' |\
+        mail -a 'From: Adam Megacz <megacz@hcoop.net>' \
+             -c admins@hcoop.net \
+             -s "you have damaged the permissions on your ~/.mire-password" $USER@hcoop.net)
+    ssh $ADMIN@fyodor.hcoop.net 'cat /home/$USER/.mire-password' && \
     create-user $USER && \
     create-user $USER && \
-    COMMAND="(cat /home/$USER/.mire-password;echo)|head -n 1"
-    COMMAND="$COMMAND;$COMMAND"
-    (ssh $ADMIN@fyodor.hcoop.net $COMMAND |\
-     change-user-password $USER) && \
+    (ssh $ADMIN@fyodor.hcoop.net "(cat /home/$USER/.mire-password;echo)|head -n 1;(cat /home/$USER/.mire-password;echo)|head -n 1" |\
+     change-user-password "$USER") && \
      (echo == account created successfully ========================================================
       echo == deleting .mire-password =============================================================
       ssh $ADMIN@fyodor.hcoop.net "echo -n > /home/$USER/.mire-password"
      (echo == account created successfully ========================================================
       echo == deleting .mire-password =============================================================
       ssh $ADMIN@fyodor.hcoop.net "echo -n > /home/$USER/.mire-password"