|  | @@ -372,6 +372,32 @@ function icecast_set_stream_name {
 | 
	
		
			
			| 372 | 372 |      start_icecast
 | 
	
		
			
			| 373 | 373 |  }
 | 
	
		
			
			| 374 | 374 |  
 | 
	
		
			
			|  | 375 | +function icecast_set_maximum_streams {
 | 
	
		
			
			|  | 376 | +    data=$(tempfile 2>/dev/null)
 | 
	
		
			
			|  | 377 | +    trap "rm -f $data" 0 1 2 5 15
 | 
	
		
			
			|  | 378 | +    dialog --title $"Set the maximum clients" \
 | 
	
		
			
			|  | 379 | +           --backtitle $"Freedombone Control Panel" \
 | 
	
		
			
			|  | 380 | +           --inputbox $"Maximum number of clients" 8 40 "10" 2>$data
 | 
	
		
			
			|  | 381 | +    sel=$?
 | 
	
		
			
			|  | 382 | +    case $sel in
 | 
	
		
			
			|  | 383 | +        0)
 | 
	
		
			
			|  | 384 | +            max_clients=$(<$data)
 | 
	
		
			
			|  | 385 | +            if [ ${#max_clients} -gt 0 ]; then
 | 
	
		
			
			|  | 386 | +                if [[ "$max_clients" != *' '* ]]; then
 | 
	
		
			
			|  | 387 | +                    if [[ $max_clients =~ '^[0-9]+$' ]] ; then
 | 
	
		
			
			|  | 388 | +                        sed -i "s|<clients>.*|<clients>${max_clients}</clients>|g" /etc/icecast2/icecast.xml
 | 
	
		
			
			|  | 389 | +                        stop_icecast
 | 
	
		
			
			|  | 390 | +                        start_icecast
 | 
	
		
			
			|  | 391 | +                        dialog --title $"Set the maximum clients" \
 | 
	
		
			
			|  | 392 | +                               --msgbox $"\nMaximum Icecast clients was set to ${max_clients}" 8 50
 | 
	
		
			
			|  | 393 | +                    fi
 | 
	
		
			
			|  | 394 | +                fi
 | 
	
		
			
			|  | 395 | +            fi
 | 
	
		
			
			|  | 396 | +            ;;
 | 
	
		
			
			|  | 397 | +    esac
 | 
	
		
			
			|  | 398 | +    rm $data
 | 
	
		
			
			|  | 399 | +}
 | 
	
		
			
			|  | 400 | +
 | 
	
		
			
			| 375 | 401 |  function configure_interactive_icecast {
 | 
	
		
			
			| 376 | 402 |      while true
 | 
	
		
			
			| 377 | 403 |      do
 | 
	
	
		
			
			|  | @@ -379,7 +405,7 @@ function configure_interactive_icecast {
 | 
	
		
			
			| 379 | 405 |          trap "rm -f $data" 0 1 2 5 15
 | 
	
		
			
			| 380 | 406 |          dialog --backtitle $"Freedombone Control Panel" \
 | 
	
		
			
			| 381 | 407 |                 --title $"Icecast" \
 | 
	
		
			
			| 382 |  | -               --radiolist $"Choose an operation:" 18 70 11 \
 | 
	
		
			
			|  | 408 | +               --radiolist $"Choose an operation:" 19 70 12 \
 | 
	
		
			
			| 383 | 409 |                 1 $"Import stream files from directory" off \
 | 
	
		
			
			| 384 | 410 |                 2 $"Import stream files from USB drive" off \
 | 
	
		
			
			| 385 | 411 |                 3 $"Manually edit playlist" off \
 | 
	
	
		
			
			|  | @@ -390,7 +416,8 @@ function configure_interactive_icecast {
 | 
	
		
			
			| 390 | 416 |                 8 $"Re-scan playlist" off \
 | 
	
		
			
			| 391 | 417 |                 9 $"Restart stream" off \
 | 
	
		
			
			| 392 | 418 |                 10 $"Set Stream Name/Description/Genre" off \
 | 
	
		
			
			| 393 |  | -               11 $"Exit" on 2> $data
 | 
	
		
			
			|  | 419 | +               11 $"Set maximum number of clients/streams" off \
 | 
	
		
			
			|  | 420 | +               12 $"Exit" on 2> $data
 | 
	
		
			
			| 394 | 421 |          sel=$?
 | 
	
		
			
			| 395 | 422 |          case $sel in
 | 
	
		
			
			| 396 | 423 |              1) break;;
 | 
	
	
		
			
			|  | @@ -412,7 +439,8 @@ function configure_interactive_icecast {
 | 
	
		
			
			| 412 | 439 |                 stop_icecast
 | 
	
		
			
			| 413 | 440 |                 start_icecast;;
 | 
	
		
			
			| 414 | 441 |              10) icecast_set_stream_name;;
 | 
	
		
			
			| 415 |  | -            11) break;;
 | 
	
		
			
			|  | 442 | +            11) icecast_set_maximum_streams;;
 | 
	
		
			
			|  | 443 | +            12) break;;
 | 
	
		
			
			| 416 | 444 |          esac
 | 
	
		
			
			| 417 | 445 |      done
 | 
	
		
			
			| 418 | 446 |  }
 |