Beispiel #1
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if existBcmWifi(iface):
		encryption = config.plugins.wlan.encryption.value
		psk = config.plugins.wlan.psk.value
		essid = config.plugins.wlan.essid.value
		ret += '\tpre-up wl-config.sh -m ' + encryption.lower() + ' -k ' + psk + ' -s "' + essid + '" \n'
		ret += '\tpost-down wl-down.sh\n'
	else:
		if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
			ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
		ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
		ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
Beispiel #2
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if existBcmWifi(iface):
		encryption = config.plugins.wlan.encryption.value
		psk = config.plugins.wlan.psk.value
		essid = config.plugins.wlan.essid.value
		ret += '\tpre-up wl-config.sh -m ' + encryption.lower() + ' -k ' + psk + ' -s "' + essid + '" \n'
		ret += '\tpost-down wl-down.sh\n'
	else:
		if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
			ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
		ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
		ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret