Changeset 576


Ignore:
Timestamp:
Jan 5, 2008, 12:43:21 AM (17 years ago)
Author:
andersk
Message:
Get the principal from klist instead of $USER.  Perform the admof
check on all lockers (not just non-$USER lockers), and after checking
that the locker exists.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • locker/bin/signup-minimal

    r575 r576  
    4848attach "$lname" 2>/dev/null
    4949
    50 if [ "$lname" != "$USER" ]; then
    51   ans=`$WGET -q -O- "http://scripts.mit.edu/~signup/admof.php/$lname/$USER@ATHENA.MIT.EDU"`
    52   if [ "$ans" != "yes" ]; then
    53     echo
    54     echo "ERROR:"
    55     echo "It appears as though you are not an administrator of the locker <$lname>."
    56     echo "Try running \"fs sa /mit/$lname $USER all\" and starting over."
    57     echo "Contact scripts@mit.edu if you are unable to solve the problem."
    58     exit 1
    59   fi
    60 fi
    61 
    62 attach "$lname" 2>/dev/null
    63 
    6450if [ ! -d "/mit/$lname" ]; then
    6551  echo
    6652  echo "ERROR:"
    6753  echo "Cannot find locker <$lname>."
     54  exit 1
     55fi
     56
     57principal=`klist -5 | sed -n 's/^Default principal: // p'`
     58ans=`$WGET -q -O- "http://scripts.mit.edu/~signup/admof.php/$lname/$principal"`
     59if [ "$ans" != "yes" ]; then
     60  afsuser=`echo "$principal" | sed 's/@ATHENA.MIT.EDU$//'`
     61  echo
     62  echo "ERROR:"
     63  echo "It appears as though you are not an administrator of the locker <$lname>."
     64  echo "Try running \"fs sa /mit/$lname $afsuser all\" and starting over."
     65  echo "Contact scripts@mit.edu if you are unable to solve the problem."
    6866  exit 1
    6967fi
Note: See TracChangeset for help on using the changeset viewer.