Changeset 458 for locker


Ignore:
Timestamp:
Oct 13, 2007, 9:21:40 PM (15 years ago)
Author:
andersk
Message:
Things that give me nightmares, volume 458.
Location:
locker/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • locker/bin/scripts-start

    r154 r458  
    44echo "What piece of software would you like to install?"
    55echo
    6 echo 1. MediaWiki
    7 echo 2. WordPress
    8 echo 3. Joomla
    9 echo 4. e107
    10 echo 5. Gallery2
    11 echo 6. phpBB
    12 echo 7. Advanced Guest Book
    13 echo 8. PHP iCalendar
     6echo "1. MediaWiki"
     7echo "2. WordPress"
     8echo "3. Joomla"
     9echo "4. e107"
     10echo "5. Gallery2"
     11echo "6. phpBB"
     12echo "7. Advanced Guest Book"
     13echo "8. PHP iCalendar"
    1414echo
    1515printf "Please enter a number 1-8: "
     
    1818
    1919attach scripts 2>/dev/null
    20 if [ "$num" -eq 1 ]; then
    21   . /mit/scripts/bin$scriptsdev/scripts-mediawiki
    22 elif [ "$num" -eq 2 ]; then
    23   . /mit/scripts/bin$scriptsdev/scripts-wordpress
    24 elif [ "$num" -eq 3 ]; then
    25   . /mit/scripts/bin$scriptsdev/scripts-joomla
    26 elif [ "$num" -eq 4 ]; then
    27   . /mit/scripts/bin$scriptsdev/scripts-e107
    28 elif [ "$num" -eq 5 ]; then
    29   . /mit/scripts/bin$scriptsdev/scripts-gallery2
    30 elif [ "$num" -eq 6 ]; then
    31   . /mit/scripts/bin$scriptsdev/scripts-phpbb
    32 elif [ "$num" -eq 7 ]; then
    33   . /mit/scripts/bin$scriptsdev/scripts-advancedbook
    34 elif [ "$num" -eq 8 ]; then
    35   . /mit/scripts/bin$scriptsdev/scripts-phpical
     20if [ "$num" = 1 ]; then
     21  . "/mit/scripts/bin$scriptsdev/scripts-mediawiki"
     22elif [ "$num" = 2 ]; then
     23  . "/mit/scripts/bin$scriptsdev/scripts-wordpress"
     24elif [ "$num" = 3 ]; then
     25  . "/mit/scripts/bin$scriptsdev/scripts-joomla"
     26elif [ "$num" = 4 ]; then
     27  . "/mit/scripts/bin$scriptsdev/scripts-e107"
     28elif [ "$num" = 5 ]; then
     29  . "/mit/scripts/bin$scriptsdev/scripts-gallery2"
     30elif [ "$num" = 6 ]; then
     31  . "/mit/scripts/bin$scriptsdev/scripts-phpbb"
     32elif [ "$num" = 7 ]; then
     33  . "/mit/scripts/bin$scriptsdev/scripts-advancedbook"
     34elif [ "$num" = 8 ]; then
     35  . "/mit/scripts/bin$scriptsdev/scripts-phpical"
    3636else
    37   echo ERROR:
    38   echo You must enter a number 1 through 8.
     37  echo "ERROR:"
     38  echo "You must enter a number 1 through 8."
    3939  exit 1
    4040fi
  • locker/bin/signup-minimal

    r438 r458  
    1212  if [ "$1" = "" ]; then
    1313    echo
    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\'.
     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'."
    1818    printf "Please enter either '1' or '2' (without quotes): "
    1919    read whofor
    20     if [ "$whofor" -eq 1 ]; then
     20    if [ "$whofor" = 1 ]; then
    2121        lname=$USER
    2222        lroot=$HOME
    23     elif [ "$whofor" -eq 2 ]; then
     23    elif [ "$whofor" = 2 ]; then
    2424        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."
    2727        echo "(For the locker /mit/sipb, you would enter sipb)."
    2828        printf "Locker name: "
     
    3131    else
    3232        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'."
    3535        exit 1
    3636    fi
     
    4040fi
    4141
    42 attach $lname 2>/dev/null
     42attach "$lname" 2>/dev/null
    4343
    4444if [ "$lname" != "$USER" ]; then
    4545  temp=$lname
    4646  lname=$USER
    47   . /mit/scripts/bin$scriptsdev/signup-minimal
     47  . "/mit/scripts/bin$scriptsdev/signup-minimal"
    4848  lname=$temp
    4949
     
    5151  if [ "$ans" != "yes" ]; then
    5252    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."
    5757    exit 0
    5858  fi
    5959fi
    6060
    61 attach $lname 2>/dev/null
     61attach "$lname" 2>/dev/null
    6262
    6363if [ ! -d "/mit/$lname" ]; then
    6464  echo
    65   echo ERROR:
    66   printf "Cannot find locker <$lname>."
     65  echo "ERROR:"
     66  echo "Cannot find locker <$lname>."
    6767  exit 0
    6868fi
    6969
    70 ans=`fs la /mit/$lname | grep "system:a.*user.*l" | wc -l`
    71 if [ "$ans" -eq 0 ]; then
     70ans=`fs la "/mit/$lname" | grep '^  system:a[nyuth]*user .*l'`
     71if [ -z "$ans" ]; then
    7272  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."
    7878  exit 0
    7979fi
    8080
    81 mkdir /mit/$lname/.scripts-signup 2>/dev/null
     81mkdir "/mit/$lname/.scripts-signup" 2>/dev/null
    8282
    8383if [ ! -d "/mit/$lname/.scripts-signup" ]; then
    8484  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."
    8888  exit 0
    8989fi
    9090
    91 athrun gnu wget -q -O/dev/null http://scripts.mit.edu/~signup/$lname
    92 rmdir /mit/$lname/.scripts-signup
     91if type wget >/dev/null 2>/dev/null; then
     92  WGET=wget
     93else
     94  WGET="athrun gnu wget"
     95fi
     96
     97$WGET -q -O/dev/null "http://scripts.mit.edu/~signup/$lname"
     98rmdir "/mit/$lname/.scripts-signup"
    9399
    94100success() {
     
    96102    echo
    97103    echo "== SUCCESS =="
    98     echo $lname is now signed up for $1.
    99     echo $2
     104    echo "$lname is now signed up for $1."
     105    echo "$2"
    100106    echo
    101107  fi
Note: See TracChangeset for help on using the changeset viewer.