Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- askWhichInterfaceForNdiswrapper(){
- TEMP=""
- for ONE in $INTERFACES
- do
- [ "$ONE" ] || continue
- TEMP="$TEMP
- <button>
- <label>$ONE</label>
- <action>EXIT:$ONE</action>
- </button>"
- done
- # don't ask if there are no interfaces at all...
- [ "$TEMP" ] || return 0
- export NETWIZ_Select_Ndiswrapper_Interface_Dialog="<window title=\"$L_TITLE_Puppy_Network_Wizard\" icon-name=\"gtk-network\" window-position=\"1\">
- <vbox>
- <pixmap icon_size=\"6\">
- <input file stock=\"gtk-dialog-question\"></input>
- </pixmap>
- <text use-markup=\"true\">
- <label>\"$L_TEXT_Ask_Which_Interface_For_Ndiswrapper\"</label>
- </text>
- <hbox>
- $TEMP
- <button>
- <label>$L_BUTTON_None</label>
- <action>EXIT:none</action>
- </button>
- <button cancel></button>
- </hbox>
- </vbox>
- </window>"
- I=$IFS; IFS=""
- for STATEMENT in $(gtkdialog3 --program NETWIZ_Select_Ndiswrapper_Interface_Dialog); do
- eval $STATEMENT
- done
- IFS=$I
- clean_up_gtkdialog NETWIZ_Select_Ndiswrapper_Interface_Dialog
- unset NETWIZ_Select_Ndiswrapper_Interface_Dialog
- case $EXIT in
- none) return 0 ;;
- Cancel|abort) return 1 ;;
- esac
- # if we got here, it's an interface
- AMOD=$(readlink /sys/class/net/$EXIT/device/driver/module)
- AMOD=${AMOD##*/}
- AMOD=${AMOD//_/-}
- #echo $AMOD
- ## Need to have an exception for the acx modules, since unloading them
- ##+ causes the kernel to become unstable
- case $AMOD in acx*) giveAcxDialog "$AMOD" || return 1 ;; esac
- # Try removing module
- if ERROR=$(rmmod $AMOD 2>&1) ; then
- # ask the user if to blacklist
- offerToBlacklistModule "$AMOD"
- # need to refresh the main gui, since # of interfaces has changed
- setDefaultMODULEBUTTONS
- refreshMainWindowInfo
- return 0
- else # failed to remove: give message
- giveErrorDialog "$L_MESSAGE_Remove_Module_Failed_p1 $AMOD.
- $L_MESSAGE_Remove_Module_Failed_p2
- $ERROR"
- return 1
- fi
- } # end askWhichInterfaceForNdiswrapper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement