# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Sven Wegener (swegener@gentoo.org) # void wlanconfig_depend(void) wlanconfig_depend() { before wireless } # void wlanconfig_expose(void) wlanconfig_expose() { variables wlanconfig wlandev wlanmode } # bool wlanconfig_check_installed(void) wlanconfig_check_installed() { [[ -x /sbin/wlanconfig ]] && return 0 ${1:-false} && eerror "For wlanconfig support, emerge net-wireless/madwifi-ng-tools" return 1 } # bool wlanconfig_start(char *iface) wlanconfig_pre_start() { local iface="${1}" ifvar="$(bash_variable "${1}")" local opt_dev="wlandev_${ifvar}" opt_mode="wlanmode_${ifvar}" opts="wlanconfig_${ifvar}" [[ -z ${!opt_dev} ]] && return 0 [[ -z ${!opt_mode} ]] && return 0 interface_exists "${!opt_dev}" true || return 1 ebegin "Creating ${iface} on ${!opt_dev} in ${!opt_mode} mode" wlanconfig "${iface}" create wlandev "${!opt_dev}" wlanmode "${!opt_mode}" ${!opts} >/dev/null eend $? } # bool wlanconfig_post_stop(char *iface) wlanconfig_post_stop() { local iface="${1}" ebegin "Destroying ${iface}" wlanconfig "${iface}" destroy eend $? } # vim: set ts=4 :