Changeset 458 for locker/bin/signup-minimal
- Timestamp:
- Oct 13, 2007, 9:21:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/bin/signup-minimal
r438 r458 12 12 if [ "$1" = "" ]; then 13 13 echo 14 echo Would you like to sign up:15 echo 1. Your personal Athena account16 echo 2. A locker that you control \(a club, a course, etc\)17 echo If you do not understand this question, you should answer \'1\'.14 echo "Would you like to sign up:" 15 echo "1. Your personal Athena account" 16 echo "2. A locker that you control (a club, a course, etc)" 17 echo "If you do not understand this question, you should answer '1'." 18 18 printf "Please enter either '1' or '2' (without quotes): " 19 19 read whofor 20 if [ "$whofor" -eq1 ]; then20 if [ "$whofor" = 1 ]; then 21 21 lname=$USER 22 22 lroot=$HOME 23 elif [ "$whofor" -eq2 ]; then23 elif [ "$whofor" = 2 ]; then 24 24 echo 25 echo OK. A locker of your choice that you control will be signed up.26 echo Please enter the name of the selected locker below.25 echo "OK. A locker of your choice that you control will be signed up." 26 echo "Please enter the name of the selected locker below." 27 27 echo "(For the locker /mit/sipb, you would enter sipb)." 28 28 printf "Locker name: " … … 31 31 else 32 32 echo 33 echo ERROR:34 echo You must select either '1' or '2'.33 echo "ERROR:" 34 echo "You must select either '1' or '2'." 35 35 exit 1 36 36 fi … … 40 40 fi 41 41 42 attach $lname2>/dev/null42 attach "$lname" 2>/dev/null 43 43 44 44 if [ "$lname" != "$USER" ]; then 45 45 temp=$lname 46 46 lname=$USER 47 . /mit/scripts/bin$scriptsdev/signup-minimal47 . "/mit/scripts/bin$scriptsdev/signup-minimal" 48 48 lname=$temp 49 49 … … 51 51 if [ "$ans" != "yes" ]; then 52 52 echo 53 echo ERROR:54 printf "It appears as though you are not an administrator of the locker <$lname>.\n"55 echo Try running \"fs sa /mit/$lname $USER all\" and starting over.56 echo Contact scripts@mit.edu if you are unable to solve the problem.53 echo "ERROR:" 54 echo "It appears as though you are not an administrator of the locker <$lname>." 55 echo "Try running \"fs sa /mit/$lname $USER all\" and starting over." 56 echo "Contact scripts@mit.edu if you are unable to solve the problem." 57 57 exit 0 58 58 fi 59 59 fi 60 60 61 attach $lname2>/dev/null61 attach "$lname" 2>/dev/null 62 62 63 63 if [ ! -d "/mit/$lname" ]; then 64 64 echo 65 echo ERROR:66 printf"Cannot find locker <$lname>."65 echo "ERROR:" 66 echo "Cannot find locker <$lname>." 67 67 exit 0 68 68 fi 69 69 70 ans=`fs la /mit/$lname | grep "system:a.*user.*l" | wc -l`71 if [ "$ans" -eq 0]; then70 ans=`fs la "/mit/$lname" | grep '^ system:a[nyuth]*user .*l'` 71 if [ -z "$ans" ]; then 72 72 echo 73 echo ERROR:74 printf "It appears as though the locker <$lname> is not listable by system:anyuser.\n"75 printf "You might want to run \"fs sa /mit/$lname system:anyuser l\"\n"76 printf "(that's a lowercase L rather than a one) and then try again.\n"77 echo Contact scripts@mit.edu if you are unable to solve the problem.73 echo "ERROR:" 74 echo "It appears as though the locker <$lname> is not listable by system:anyuser." 75 echo "You might want to run \"fs sa /mit/$lname system:anyuser l\"" 76 echo "(that's a lowercase L rather than a one) and then try again." 77 echo "Contact scripts@mit.edu if you are unable to solve the problem." 78 78 exit 0 79 79 fi 80 80 81 mkdir /mit/$lname/.scripts-signup2>/dev/null81 mkdir "/mit/$lname/.scripts-signup" 2>/dev/null 82 82 83 83 if [ ! -d "/mit/$lname/.scripts-signup" ]; then 84 84 echo 85 echo ERROR:86 printf "It appears as though you do not have write access to the locker <$lname>.\n"87 echo Contact scripts@mit.edu if you are unable to solve the problem.85 echo "ERROR:" 86 echo "It appears as though you do not have write access to the locker <$lname>." 87 echo "Contact scripts@mit.edu if you are unable to solve the problem." 88 88 exit 0 89 89 fi 90 90 91 athrun gnu wget -q -O/dev/null http://scripts.mit.edu/~signup/$lname 92 rmdir /mit/$lname/.scripts-signup 91 if type wget >/dev/null 2>/dev/null; then 92 WGET=wget 93 else 94 WGET="athrun gnu wget" 95 fi 96 97 $WGET -q -O/dev/null "http://scripts.mit.edu/~signup/$lname" 98 rmdir "/mit/$lname/.scripts-signup" 93 99 94 100 success() { … … 96 102 echo 97 103 echo "== SUCCESS ==" 98 echo $lname is now signed up for $1.99 echo $2104 echo "$lname is now signed up for $1." 105 echo "$2" 100 106 echo 101 107 fi
Note: See TracChangeset
for help on using the changeset viewer.