Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadNdiswrapperModule ()
- {
- # Dougal: ask the user if there's an interface for the HW, so we know
- #+ to remove the driver for it.
- askWhichInterfaceForNdiswrapper || return
- showNdiswrapperGUI
- [ $? -eq 0 ] || return
- ndiswrapper -m
- #v4.00 bugfix...
- NATIVEMOD=""
- nwINTERFACE="$(grep '^alias .* ndiswrapper$' /etc/modprobe.conf | cut -f 2 -d ' ')"
- #most likely 'wlan0'
- #if this interface is already claimed by a native linux driver,
- #then get rid of it...
- ## Dougal: this isn't good: the interface name is not the problem, it's the HW!
- ## Add a dialog at the top for it.
- if [ -n "$nwINTERFACE" -a -e "/sys/class/net/$nwINTERFACE" ];then
- NATIVEMOD="$(readlink /sys/class/net/${nwINTERFACE}/device/driver/module)"
- NATIVEMOD=${NATIVEMOD##*/}
- if [ "$NATIVEMOD" != "ndiswrapper" ];then
- #note 'ndiswrapper -l' also returns the native linux module.
- if iwconfig | grep "^${nwINTERFACE} " | grep 'IEEE' | grep -q 'ESSID' ;then
- rmmod "$NATIVEMOD"
- sleep 6
- [ $INTERFACE_NUM -gt 0 ] && INTERFACE_NUM=$((INTERFACE_NUM-1))
- #...needed later to determine that number of interfaces has changed with ndiswrapper.
- #INTERFACES="$(ifconfig -a | grep -F 'Link encap:Ethernet' | cut -f1 -d' ' | tr '\n' ' ')"
- getInterfaceList
- #...also needed later.
- fi
- else
- NATIVEMOD=""
- fi
- fi
- tryLoadModule "ndiswrapper"
- ndRETVAL=$?
- #v4.00...
- if [ $ndRETVAL -eq 0 ];then
- #well let's be radical, blacklist the native driver...
- if [ "$NATIVEMOD" != "" ];then
- #if ! grep "^${NATIVEMOD}$" "$BLACKLIST_FILE" ;then
- . /etc/rc.d/MODULESCONFIG
- case $SKIPLIST in *" $NATIVEMOD "*|*" ${NATIVEMOD//_/-} "*) ;; *)
- Xdialog --title "$L_TITLE_Puppy_Network_Wizard" --yesno \
- "$L_MESSAGE_Blacklist_Nativemod_p1 ${NATIVEMOD} $L_MESSAGE_Blacklist_Nativemod_p2" 0 0
- if [ $? -eq 0 ] ; then
- #echo "$NATIVEMOD" >> "$BLACKLIST_FILE"
- blacklist_module "$NATIVEMOD"
- fi
- ;;
- esac
- #fi
- fi
- fi #if [ $ndRETVAL -eq 0 ];then
- return $ndRETVAL
- } # end loadNdiswrapperModule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement