source: locker/bin/scripts-start @ 997

Last change on this file since 997 was 997, checked in by andersk, 16 years ago
Automatic numbering in scripts-start.
  • Property svn:executable set to *
File size: 760 bytes
Line 
1#!/bin/sh
2
3choices () {
4    echo 'mediawiki MediaWiki'
5    echo 'wordpress WordPress'
6    echo 'joomla Joomla'
7    echo 'e107 e107'
8    echo 'gallery2 Gallery2'
9    echo 'phpbb phpBB'
10    echo 'advancedbook Advanced Guest Book'
11    echo 'phpical PHP iCalendar'
12    echo 'trac Trac'
13    echo 'turbogears TurboGears'
14}
15
16nchoices=`choices | wc -l`
17
18echo
19echo "What piece of software would you like to install?"
20echo
21choices | sed 's/^[^ ]* //' | cat -n
22echo
23printf "Please enter a number 1-%d: " "$nchoices"
24read num
25echo
26
27attach scripts 2>/dev/null
28choice=`choices | sed -n "$num { s/ .*$//; p; }"`
29if [ -n "$choice" ]; then
30  . "/mit/scripts/bin$scriptsdev/scripts-$choice"
31else
32  echo "ERROR:"
33  echo "You must enter a number 1 through $nchoices."
34  exit 1
35fi
Note: See TracBrowser for help on using the repository browser.