X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/3b8ce6f62deaf835311cd63ad675bea7013c91ff..fcb632a28d698e5e3c4463b2db184025555015a2:/scripts/setup.in diff --git a/scripts/setup.in b/scripts/setup.in index e89ddb4..3a0c66b 100755 --- a/scripts/setup.in +++ b/scripts/setup.in @@ -27,6 +27,7 @@ while [ $# -gt 0 ]; do case "$opt" in -h | --help ) cat <&2 "ERROR: unknown option '$opt'" exit 1 @@ -169,10 +191,50 @@ if [ -z "$port" ]; then done fi -if [ -z "$smtp_server" ]; then - echo - echo "What host should DisOrder use as an SMTP server?" - read -r smtp_server +if [ -z "$play" ]; then + while :; do + echo + echo "How do you want to play sound? Enter 'local' to use a local sound" + echo "device or 'network' to multicast sound across your network." + read -r play + case $play in + 'local' | network ) + break + ;; + * ) + echo "Enter 'local' or 'network'" + continue + ;; + esac + done +fi + +if [ "x$play" = xnetwork ]; then + if [ -z "$mcast_address" ]; then + echo + echo "Enter destination address for network transmission" + echo "(e.g. a multicast address)" + read -r mcast_address + fi + if [ -z "$mcast_port" ]; then + while :; do + echo + echo "Enter destination port for network transmission" + read -r mcast_port + case $mcast_port in + none ) + break + ;; + [^0-9] ) + echo "'$mcast_port' is not a valid port number" + continue + ;; + * ) + break + ;; + esac + done + fi fi if [ -z "$mail_sender" ]; then @@ -196,7 +258,7 @@ if [ -z "$register" ]; then echo echo "Do you want to enable online registration? (Enter 'y' or 'n')" read -r register - case $reguser in + case $register in y | n ) break ;; @@ -212,9 +274,14 @@ if [ $port = none ]; then else echo " TCP port to listen on: $port" fi -echo " SMTP Server: $smtp_server" +if [ ! -z "$smtp_server" ]; then + echo " SMTP Server: $smtp_server" +fi echo " Sender address: $mail_sender" echo " Online registration: $register" +if [ $play = network ]; then + echo " Send sound to: $mcast_address port $mcast_port" +fi echo "Is this OK? (Enter 'y' or 'n')" read -r ok @@ -241,7 +308,12 @@ echo "user $user" >> pkgconfdir/config.new if [ $port != none ]; then echo "listen 0.0.0.0 $port" >> pkgconfdir/config.new fi -echo "smtp_server $smtp_server" >> pkgconfdir/config.new +if [ $play = network ]; then + echo "broadcast $mcast_address $mcast_port" >> pkgconfdir/config.new +fi +if [ ! -z "$smtp_server" ]; then + echo "smtp_server $smtp_server" >> pkgconfdir/config.new +fi echo "mail_sender $mail_sender" >> pkgconfdir/config.new echo @@ -462,7 +534,7 @@ if [ -z "$CGIBIN" ]; then echo "Cannot find your web server's cgi-bin directory" else echo "Installing CGI in $CGIBIN" - install -m 555 server/disorder.cgi $CGIBIN/disorder + install -m 555 cgi/disorder.cgi $CGIBIN/disorder fi if $server_running; then