Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25
  1. #21
    Quote Originally Posted by PapaCharlie9 View Post
    Try it without the quotes around the ip addresses:

    Code:
    	case "$servers" in
    		123.45.67.89)
    		    port="28260"
    		    ;;
    		123.45.67.90)
    		    port="27260"
    		    ;;
    		...
    	esac
    Still the same unfortunately.

  2. #22
    What's the whole script? Maybe you've got the case statement outside of the loop by accident?
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  3. #23
    Quote Originally Posted by PapaCharlie9 View Post
    What's the whole script? Maybe you've got the case statement outside of the loop by accident?
    Right now it's like this:
    Code:
    #!/bin/bash
    user="user"
    pw="pass"
    servers=(***.**.**.24 ***.**.**.66 ***.**.**.59 ***.**.**.67 ***.**.**.58 ***.**.**.70 ***.**.**.68)
    
    	case "$servers" in
    		***.**.**.24)
    		port=28260
    		;;
    		***.**.**.58)
    		port=27260
    		;;
    		***.**.**.59)
    		port=27260
    		;;
    		***.**.**.66)
    		port=28270
    		;;
    		***.**.**.67)
    		port=27290
    		;;
    		***.**.**.68)
    		port=28260
    		;;
    		***.**.**.70)
    		port=28260
    		;;
    	esac
    
    for server in ${servers[*]}
    do
    path="$server%20port%20$port"
    files=( `exec find Plugins -name '*.cs' -o -name '*.inc'` )
    	for file in ${files[*]}
    	do
    	echo	curl -u $user:$pw -T $file ftp://$server/$path/$file
    			curl -u $user:$pw -T $file ftp://$server/$path/$file
    	done	
    done

  4. #24
    That's what I suspected. The case statement is in the wrong place. Try this:

    Code:
    #!/bin/bash
    user="user"
    pw="pass"
    servers=(***.**.**.24 ***.**.**.66 ***.**.**.59 ***.**.**.67 ***.**.**.58 ***.**.**.70 ***.**.**.68)
    
    
    for server in ${servers[*]}
    do
    	case "$servers" in
    		***.**.**.24)
    		port=28260
    		;;
    		***.**.**.58)
    		port=27260
    		;;
    		***.**.**.59)
    		port=27260
    		;;
    		***.**.**.66)
    		port=28270
    		;;
    		***.**.**.67)
    		port=27290
    		;;
    		***.**.**.68)
    		port=28260
    		;;
    		***.**.**.70)
    		port=28260
    		;;
    	esac
    
    path="$server%20port%20$port"
    files=( `exec find Plugins -name '*.cs' -o -name '*.inc'` )
    	for file in ${files[*]}
    	do
    	echo	curl -u $user:$pw -T $file ftp://$server/$path/$file
    			curl -u $user:$pw -T $file ftp://$server/$path/$file
    	done	
    done
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  5. #25
    Oh god! Why do i even try....

    Well, that works! Will update first post in the morning!

    Big thanks!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •