A set of POSIX* shell scripts designed for personal use. No guarantees when it comes to quality, as these are also used for various minor experiments of mine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
POSIX_Scripts/netsh

59 lines
1.3 KiB

#!/usr/bin/env sh
#This is a poorly-written script and should be ignored.
printf "\nWhat do you want to do?\n1. Configure\n2. Scan\n3. View\n>: "
read choice
case $choice in
1)
printf "Not ready yet.\n"
;;
2)
printf "\nScan with which interface?\n"
ifconfig -l | tr ' ' '\n' | grep wl | nl | awk '{printf $1 ". " $2 "\n"}'
printf ">: "
read choice
dev=`ifconfig -l | tr ' ' '\n' | grep wl | sed $choice!d`
iw dev $dev scan | grep SSID | $PAGER
;;
3)
printf "\nView what?\n1. Interface information\n2. Routing table\n>: "
read choice
case $choice in
1)
x=1
i=$((`ifconfig -l | tr ' ' '\n' | wc -l`+1))
printf "\nWhich interface?\n"
while [ $x -lt $i ]
do ifconfig -l | tr ' ' '\n' | nl | sed $x!d | awk '{printf $1 ". " $2 "\n"}'
x=$(($x+1))
done
printf ">: "
read choice
printf "\n" ; ifconfig -l | tr ' ' '\n' | sed $choice!d | awk '{printf "ifconfig " $1 "\n"}' | sh -e --
;;
2)
printf "\n" ; route ; printf "\n"
;;
*)
printf "Illegal input. Aborting.\n"
;;
esac
;;
*)
printf "Illegal input. Aborting.\n"
;;
esac
exit