X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/64ac73bb108b7858746281161f0450d2269fce7d..06f35ddcffa7e9d5a6c6b53cbb07ef11fab49f95:/scripts/setup.in diff --git a/scripts/setup.in b/scripts/setup.in index 48f87c2..b7fdecd 100755 --- a/scripts/setup.in +++ b/scripts/setup.in @@ -3,20 +3,18 @@ # This file is part of DisOrder # Copyright (C) 2008 Richard Kettlewell # -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA +# along with this program. If not, see . # set -e @@ -151,23 +149,31 @@ if [ -z "$roots" ]; then echo "(enter one or more directories separated by spaces)" read -r roots ok=true + anyroots=false for root in $roots; do if [ ! -d $root ]; then echo "'$root' does not exist" ok=false + else + anyroots=true fi done - if $ok; then + if $anyroots && $ok; then break fi done fi if [ -z "$encoding" ]; then - echo - echo "What filesystem encoding should I assume for track names?" - echo "(e.g. UTF-8, ISO-8859-1, ...)" - read -r encoding + while :; do + echo + echo "What filesystem encoding should I assume for track names?" + echo "(e.g. UTF-8, ISO-8859-1, ...)" + read -r encoding + if [ ! -z "$encoding" ]; then + break + fi + done fi if [ -z "$port" ]; then @@ -180,7 +186,7 @@ if [ -z "$port" ]; then none ) break ;; - [^0-9] ) + [^0-9] | "" ) echo "'$port' is not a valid port number" continue ;; @@ -225,7 +231,7 @@ if [ "x$play" = xnetwork ]; then none ) break ;; - [^0-9] ) + [^0-9] | "" ) echo "'$mcast_port' is not a valid port number" continue ;; @@ -269,7 +275,7 @@ fi echo echo "Proposed DisOrder setup:" echo " Music directory: $roots" -if [ $port = none ]; then +if [ "$port" = none ]; then echo " Do not listen on a TCP port" else echo " TCP port to listen on: $port"