# 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 functions interface_exists } # 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}" # If we have no settings for this interface, ignore it silently [[ -z ${!opt_dev} ]] && return 0 [[ -z ${!opt_mode} ]] && return 0 # If the interface already exists, we assume everything is ok interface_exists "${face}" && return 0 # The wlandev interface needs to exist 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}" ifvar="$(bash_variable "${1}")" local opt_dev="wlandev_${ifvar}" opt_mode="wlanmode_${ifvar}" # If we have no settings for this interface, ignore it silently [[ -z ${!opt_dev} ]] && return 0 [[ -z ${!opt_mode} ]] && return 0 ebegin "Destroying ${iface}" wlanconfig "${iface}" destroy eend ${?} } # vim: set ts=4 :