#!/bin/sh
# create essid from channel, takes two args:
# $1 = channel (integer)
# $2 = community (optional)
channel=$1
community=$2

. /etc/functions.sh


# Try to get BSSID from profile first
config_load profile_$community
config_get bssid bssidscheme $channel

if [ -z "$bssid" ]; then
	case $channel in
	[1-9])
		bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE"
		;;
	1[0-4])
		bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE"
		;;
	[3-9][0-9])
		bssid="00:$channel:CA:FF:EE:EE"
		;;
	1[0-9][0-9])
		bssid="${channel/1/01:}:CA:FF:EE:EE"
		;;
	*)	bssid="02:CA:FF:EE:BA:BE"
		;;
	esac
fi
echo $bssid

#!/bin/sh
# create essid from channel, takes two args:
# $1 = channel (integer)
# $2 = community (optional)
channel=$1
community=$2

. /etc/functions.sh


# Try to get BSSID from profile first
config_load profile_$community
config_get bssid bssidscheme $channel
config_get bssid_all bssidscheme "all"

if [ -z "$bssid" ] && [ -z "$bssid_all" ]; then
	case $channel in
	[1-9])
		bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE"
		;;
	1[0-4])
		bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE"
		;;
	[3-9][0-9])
		bssid="00:$channel:CA:FF:EE:EE"
		;;
	1[0-9][0-9])
		bssid="${channel/1/01:}:CA:FF:EE:EE"
		;;
	*)	bssid="02:CA:FF:EE:BA:BE"
		;;
	esac
fi
echo $bssid

Add option in community profiles to set the same bssid for every channel with bssidscheme 'all'
contrib/meshwizard: Add option in community profiles to set the same bssid for every channel with bssidscheme 'all'
