#!/bin/bash
clear
HEIGHT=27
WIDTH=80
CHOICE_HEIGHT=6
BACKTITLE="PMP ndiswrapper Wifi helper v.0.0.1 by Abe_"
TITLE="PMP Wifi v.0.0.1"
MENU="Select one of the following Options:"
OPTIONS=(1 "Install a Driver"
2 "Show .inf configuration in /etc/ndiswrapper/"
3 "Show Driver Status"
4 "Load ndiswrapper driver at System Start"
5 "Load ndiswrapper module"
6 "Delete Ndiswrapper driver"
7 "Install Ndiswrapper"
8 "Delete Ndiswrapper completely"
9 "Exit")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
printf "You need to get the Windows driver for your adapter!\n"
printf "Download and extract it. Look in the extracted directory for a file ending in .inf\n"
printf "This is the file that holds all the driver information.\n"
printf "You must Enter the path of the .inf here:"
read ndisk
sudo ndiswrapper -i $ndisk
;;
2)
ls -rl /etc/ndiswrapper/*/*
;;
3)
ndiswrapper -l
;;
4)
sudo ndiswrapper -ma
;;
5)
echo "loading ndiswrapper module...";
sudo modprobe -v ndiswrapper
;;
6)
echo "Ok First we need to find out the name of you driver";
sudo ndiswrapper -l
echo "Good now type or paste the driver you want to delete in here:";
read driver
sudo ndiswrapper -r $driver
;;
7)
echo "starting sudo:";
let x=2;while [ $x -gt 0 ];do echo "$x";let x=$x-1;sleep 1;done
sudo apt-get install dkms ndiswrapper-utils-1.9 ndiswrapper-common ndisgtk ndiswrapper-dkms gksu
;;
8)
echo "starting sudo";
sudo apt-get purge ndiswrapper-common ndiswrapper-utils-1.9 ndiswrapper-modules-1.9
echo "To clear all configuration files check /etc/ndiswrapper/ or use Option 6 in the PMP Wifi menu"
;;
9)
echo "Good bye";
exit
esac
;;