--- Install-sh.orig Tue Mar 23 22:07:57 1999 +++ Install-sh Tue Mar 23 22:44:37 1999 @@ -7,14 +7,55 @@ # (c) Nobreak Technologies, Inc. # -# yes/no +# check_prefix +check_prefix() { + cat << __EOF__ +#################################################################### +## FreeBSD Ports Collection : www : crazywwwboardle ## +## ## +## The FreeBSD Project http://www.FreeBSD.org ## +## Korea FreeBSD Users Group http://www.kr.FreeBSD.org ## +#################################################################### +__EOF__ + + echo "" + echo "--[ Checking PREFIX directories ]-----------------------------------" + if [ ! "$PREFIX" ]; then + PREFIX="/usr/local" + fi + + for dir in "$PREFIX" "$PREFIX/www" "$PREFIX/www/cgi-bin" "$PREFIX/www/data"; do + printf "Checking $dir : " + if [ -d "$dir" ]; then + echo "OK." + else + printf "Not found! " + mkdir "$dir" + if [ -d "$dir" ]; then + echo "(Created) OK." + else + echo "" + quit "Required directory($dir) creation fail!" + fi + fi + done + echo "--------------------------------------------------------------------" + printf "Looks good... Here we go~~~" + sleep 1 + echo "" + echo "" +} +# yes/no yesno() { key="" while true; do printf "$1 [y/n] : " - read key + sleep 1 + echo "$2" + key="$2" + sleep 1 case "$key" in [Yy] | [Yy][Ee][Ss] ) break @@ -70,7 +111,7 @@ #################################################################### __EOF__ -yesno "Do you accept all the terms of the license agreement?" "Sorry, If you don't accept our license agreement, you can not use this product!" +yesno "Do you accept all the terms of the license agreement?" "Y" "Sorry, If you don't accept our license agreement, you can not use this product!" echo "" } @@ -216,7 +257,7 @@ fi printf "Looks good... Press ENTER to continue..." - read x + sleep 1 echo "" echo "From now we will try to install. Answer to the questions please." @@ -232,7 +273,10 @@ echo " ex) /usr/local/etc/httpd/cgi-bin" echo " ex) $HOME/public_html/cgi-bin" printf "____________________________________________________________________\r o INPUT -> " - read cgiBin + sleep 1 + echo "$PREFIX/www/cgi-bin" + cgiBin="$PREFIX/www/cgi-bin" + sleep 1 printf " Checking directory '$cgiBin' : " if [ -d "$cgiBin" ]; then @@ -253,7 +297,10 @@ echo " ex) /usr/local/etc/httpd/htdocs" echo " ex) $HOME/public_html" printf "____________________________________________________________________\r o INPUT -> " - read docRoot + sleep 1 + echo "$PREFIX/www/data" + docRoot="$PREFIX/www/data" + sleep 1 printf " Checking directory '$docRoot' : " if [ -d "$docRoot" ]; then @@ -261,7 +308,7 @@ if [ ! -d "$docRoot/$data" ]; then echo "OK" else - quit "'$docRoot/$data' already exist." + echo "Found 'cwb-data' under "$docRoot/$data". Is this time reinstall or upgrade? Don't worry we do not touch your databases. OK" fi else quit "Can not write in this directory" @@ -278,10 +325,13 @@ echo " If you don't understand this meaning, choose 'n'." while true; do printf " x xxxxx xx [_]\r o INPUT -> [" - read cgiwrap + sleep 1 + echo "N" + cgiwrap="N" + sleep 1 case "$cgiwrap" in [Yy] ) - yesno " Are you sure? Do you really use 'CGIWrap?" " Please, try again..." + yesno " Are you sure? Do you really use 'CGIWrap?" "Y" " Please, try again..." cgiwrap="Y" break ;; @@ -297,7 +347,10 @@ echo " ex) http://$host" echo " ex) http://$host/~$USER" printf "____________________________________________________________________\r o INPUT -> http://" - read homeUrl + sleep 1 + echo "$host" + homeUrl="www.kr.freebsd.org" + sleep 1 if [ ! "$homeUrl" ]; then quit "Homepage URL must be entered. Try again, please." @@ -317,7 +370,10 @@ echo " @ Enter your name, please..." echo " ex) Impellitteri Chris" printf "____________________________________________________________________\r o INPUT -> " - read adminName + sleep 1 + echo "Your Name" + adminName="Your Name" + sleep 1 if [ ! "$adminName" ]; then quit "Name must be entered. Try again, please." @@ -326,7 +382,10 @@ echo " @ Enter your email address, please..." printf "____________________________________________________________________\r o INPUT -> " - read adminEmail + sleep 1 + echo "your@email" + adminEmail="your@email" + sleep 1 if [ ! "$adminEmail" ]; then quit "Email address must be entered. Try again, please." @@ -338,7 +397,10 @@ while true; do printf " x xxxxx xx [__]\r o INPUT -> [" - read lang + sleep 1 + echo "EN" + lang="EN" + sleep 1 case "$lang" in [Ee][Nn] ) lang="en" @@ -360,8 +422,8 @@ # Confirm confirm() { echo "--------------------------------------------------------------------" - echo "" - echo "Dear $adminName" + #echo "" + #echo "Dear $adminName" echo "" echo "Now we will do below things to install." echo "" @@ -379,7 +441,7 @@ echo "3. 'CrazyWWWBoard.cgi' -> '$cgiBin'" echo "4. Creating directory '$docRoot/$data' and making sub structures." echo "--------------------------------------------------------------------" - yesno "All looks good?" "Please, try again..." + yesno "All looks good?" "Y" "Please, try again..." echo "" } @@ -441,7 +503,7 @@ echo "Step 4 : Copying related data structures." echo "--------------------------------------------------------------------" printf "Copying '$data' to '$docRoot/$data' : " - cp -rp "$data" "$docRoot/$data" + cp -rp "$data/" "$docRoot/$data/" if [ -d "$docRoot/$data" ]; then echo "OK" else @@ -452,7 +514,7 @@ echo "Successfully completed." printf "Press ENTER to continue..." - read x + sleep 1 echo "" } @@ -462,6 +524,8 @@ # Main routine # ################################################################################ + +check_prefix display_info