mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	Mostly wording changes and added echos to show script progress.
This commit is contained in:
		| @@ -7,15 +7,15 @@ | |||||||
| #  Required values are SSID, radio, and endpoint A port. | #  Required values are SSID, radio, and endpoint A port. | ||||||
| #  -m   Manager IP or hostname. | #  -m   Manager IP or hostname. | ||||||
| #  -r   Resource number. | #  -r   Resource number. | ||||||
| #  -w   Which radio to use i.e wiphy0 wiphy1 etc. | #  -w   Which radio to use i.e. wiphy0 wiphy1 etc. | ||||||
| #  -n   Number of stations to create. | #  -n   Number of stations to create. | ||||||
| #  -s   SSID for stations. | #  -s   SSID for stations. | ||||||
| #  -e   Encryption type: open|wep|wpa|wpa2. | #  -e   Encryption type: open|wep|wpa|wpa2. | ||||||
| #  -P   Passphrase for when AP is encrypted. | #  -k   Passphrase for when AP is encrypted. | ||||||
| #  -a   Port the station(s) will connect to. | #  -a   The upstream port to which station(s) will connect. | ||||||
| #  -A   Transmit rate for non station side (Endpoint A) of connection. | #  -A   Transmit rate for non station side (Endpoint A) of connection. | ||||||
| #  -B   Transmit rate for station side (Endpoint B) of connection. | #  -B   Transmit rate for station side (Endpoint B) of connection. | ||||||
| #  -p   Number of packets to send. | #  -p   Number of default UDP sized packets to send. | ||||||
| #  -h   Help information. | #  -h   Help information. | ||||||
|  |  | ||||||
| #  Example usage: | #  Example usage: | ||||||
| @@ -51,15 +51,15 @@ can all be configured with the below options. | |||||||
| Required values are SSID, radio, and endpoint A port. | Required values are SSID, radio, and endpoint A port. | ||||||
| -m   Manager IP or hostname. | -m   Manager IP or hostname. | ||||||
| -r   Resource number. | -r   Resource number. | ||||||
| -w   Which radio to use i.e wiphy0 wiphy1 etc. | -w   Which radio to use i.e. wiphy0 wiphy1 etc. | ||||||
| -n   Number of stations to create. | -n   Number of stations to create. | ||||||
| -s   SSID for stations. | -s   SSID for stations. | ||||||
| -e   Encryption type: open|wep|wpa|wpa2. | -e   Encryption type: open|wep|wpa|wpa2. | ||||||
| -P   Passphrase for when AP is encrypted. | -k   Passphrase for when AP is encrypted. | ||||||
| -a   Port the station(s) will connect to. | -a   The upstream port to which station(s) will connect. | ||||||
| -A   Transmit rate for non station side (Endpoint A) of connection. | -A   Transmit rate for non station side (Endpoint A) of connection. | ||||||
| -B   Transmit rate for station side (Endpoint B) of connection. | -B   Transmit rate for station side (Endpoint B) of connection. | ||||||
| -p   Number of packets to send. | -p   Number of default UDP sized packets to send. | ||||||
| -h   Help information. | -h   Help information. | ||||||
|  |  | ||||||
| Example usage: | Example usage: | ||||||
| @@ -67,7 +67,7 @@ Example usage: | |||||||
|  |  | ||||||
| Station will always be endpoint B so only the name for endpoint A port is needed." | Station will always be endpoint B so only the name for endpoint A port is needed." | ||||||
|  |  | ||||||
| while getopts 'm:r:n:p:a:e:P:w:s:A:B:h' OPTION; do | while getopts 'm:r:n:p:a:e:k:w:s:A:B:h' OPTION; do | ||||||
|    case "$OPTION" in |    case "$OPTION" in | ||||||
|       m) |       m) | ||||||
|         #manager |         #manager | ||||||
| @@ -81,7 +81,7 @@ while getopts 'm:r:n:p:a:e:P:w:s:A:B:h' OPTION; do | |||||||
|         #num stations |         #num stations | ||||||
|         num_stas="$OPTARG" |         num_stas="$OPTARG" | ||||||
|         ;; |         ;; | ||||||
|       p) |       k) | ||||||
|         #packets |         #packets | ||||||
|         num_packets="$OPTARG" |         num_packets="$OPTARG" | ||||||
|         ;; |         ;; | ||||||
| @@ -128,13 +128,11 @@ shift "$(($OPTIND -1))" | |||||||
| #check for required getopts | #check for required getopts | ||||||
| if [ "$flag_ssid" = false ] || [ "$flag_radio" = false ] || [ "$flag_port" = false ] ; | if [ "$flag_ssid" = false ] || [ "$flag_radio" = false ] || [ "$flag_port" = false ] ; | ||||||
| then | then | ||||||
|    echo "Please provide at minimum the port the station will connect to (-a), ssid (-s), and radio (-w)" |    echo "Please provide at minimum the port the station will connect to (-a), ssid (-s), and radio (-w). Run the script with -h for more information." | ||||||
|    exit 1 |    exit 1 | ||||||
| fi | fi | ||||||
|  |  | ||||||
| . $HOME/lanforge.profile | echo "Deleting old stations." | ||||||
|  |  | ||||||
|  |  | ||||||
| ./lf_associate_ap.pl --mgr $mgr --resource $resource --action del_all_phy --port_del $radio | ./lf_associate_ap.pl --mgr $mgr --resource $resource --action del_all_phy --port_del $radio | ||||||
|  |  | ||||||
| ./lf_firemod.pl --mgr $mgr --resource $resource --quiet yes --action do_cmd \ | ./lf_firemod.pl --mgr $mgr --resource $resource --quiet yes --action do_cmd \ | ||||||
| @@ -142,10 +140,12 @@ fi | |||||||
|  |  | ||||||
| sleep 2 | sleep 2 | ||||||
|  |  | ||||||
|  | echo "Creating new stations." | ||||||
| ./lf_associate_ap.pl --mgr $mgr --resource $resource \ | ./lf_associate_ap.pl --mgr $mgr --resource $resource \ | ||||||
|  --ssid $ssid --security $encryption --passphrase $passphrase \ |  --ssid $ssid --security $encryption --passphrase $passphrase \ | ||||||
|  --num_stations $num_stas --first_sta "sta$first_sta" \ |  --num_stations $num_stas --first_sta "sta$first_sta" \ | ||||||
|  --first_ip DHCP --radio $radio --action add |  --first_ip DHCP --radio $radio --action add | ||||||
|  | sleep 2 | ||||||
|  |  | ||||||
| function new_cx(){ | function new_cx(){ | ||||||
|    local cx=$1 |    local cx=$1 | ||||||
| @@ -170,6 +170,7 @@ function new_cx(){ | |||||||
| } | } | ||||||
|  |  | ||||||
| # Delete all connections and endpoints that have 'bg' in the name | # Delete all connections and endpoints that have 'bg' in the name | ||||||
|  | echo "Deleting old connections." | ||||||
| cx_array=( `./lf_firemod.pl --mgr $mgr --resource $resource --action list_cx | awk '/bg/ { print $ 2 }' | sed 's/,$//'`  ) | cx_array=( `./lf_firemod.pl --mgr $mgr --resource $resource --action list_cx | awk '/bg/ { print $ 2 }' | sed 's/,$//'`  ) | ||||||
| for i in "${cx_array[@]}" | for i in "${cx_array[@]}" | ||||||
|    do |    do | ||||||
| @@ -183,9 +184,12 @@ for i in "${cx_array[@]}" | |||||||
|  |  | ||||||
| sleep 5 | sleep 5 | ||||||
|  |  | ||||||
|  | echo "Creating new connections." | ||||||
| last_sta=$((first_sta + num_stas - 1)) | last_sta=$((first_sta + num_stas - 1)) | ||||||
| for i in `seq $first_sta $last_sta`; do | for i in `seq $first_sta $last_sta`; do | ||||||
|    new_cx bg$i $port_A sta$i |    new_cx bg$i $port_A sta$i | ||||||
| done | done | ||||||
|  |  | ||||||
|  | echo "All stations and connections have been created." | ||||||
|  |  | ||||||
| /lf_firemod.pl --mgr $mgr --resource $resource --quiet yes --action do_cmd --cmd 'nc_show_endpoints all' &>/dev/null | /lf_firemod.pl --mgr $mgr --resource $resource --quiet yes --action do_cmd --cmd 'nc_show_endpoints all' &>/dev/null | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Brent Lovelace
					Brent Lovelace