summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-11-01 11:13:53 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2012-11-01 11:13:53 -0600
commit512eee2d4747d582f96686e625055871598706dc (patch)
treecba506eeccdf6db353e20c2186b3fe21da758ee6
parentAdd reset module, spoofing convience script, and make normal do a reset instead of a start. (diff)
downloadwifi-monitoring-scripts-512eee2d4747d582f96686e625055871598706dc.tar.xz
wifi-monitoring-scripts-512eee2d4747d582f96686e625055871598706dc.zip
Modernize scripts.
Diffstat (limited to '')
-rwxr-xr-xmac.sh10
-rwxr-xr-xmonitor.sh8
-rwxr-xr-xnormal.sh6
-rwxr-xr-xreset-module.sh20
-rwxr-xr-xspoof.sh11
5 files changed, 35 insertions, 20 deletions
diff --git a/mac.sh b/mac.sh
index 3f1d397..2c55a50 100755
--- a/mac.sh
+++ b/mac.sh
@@ -7,10 +7,12 @@ if [[ $# -ne 1 ]]; then
exit -1
fi
-systemctl stop dhcpcd.service
-systemctl stop wpa_supplicant.service
+/etc/init.d/dhcpcd stop
+/etc/init.d/wpa_supplicant stop
+
ifconfig wlan0 down
macchanger -m $1 wlan0
ifconfig wlan0 up
-systemctl start dhcpcd.service
-systemctl start wpa_supplicant@wlan0.service
+
+/etc/init.d/dhcpcd start
+/etc/init.d/wpa_supplicant start
diff --git a/monitor.sh b/monitor.sh
index 9a98099..2c11ecf 100755
--- a/monitor.sh
+++ b/monitor.sh
@@ -2,13 +2,15 @@ if [[ $UID != 0 ]]; then
echo "You must be root."
exit -1
fi
-systemctl stop dhcpcd.service
-systemctl stop wpa_supplicant@wlan0.service
+
+/etc/init.d/dhcpcd stop
+/etc/init.d/wpa_supplicant stop
+
if [ $# -eq 1 ]; then
ifconfig wlan0 down
iwconfig wlan0 mode managed
ifconfig wlan0 up
- iwconfig wlan0 channel $1
+ iwconfig wlan0 freq $1
fi
ifconfig wlan0 down
iwconfig wlan0 mode monitor
diff --git a/normal.sh b/normal.sh
index 29d36e3..dbb95aa 100755
--- a/normal.sh
+++ b/normal.sh
@@ -2,7 +2,9 @@ if [[ $UID != 0 ]]; then
echo "You must be root."
exit -1
fi
+
ifconfig wlan0 down
ifconfig wlan0 up
-systemctl restart dhcpcd.service
-systemctl restart wpa_supplicant@wlan0.service
+
+/etc/init.d/dhcpcd restart
+/etc/init.d/wpa_supplicant restart
diff --git a/reset-module.sh b/reset-module.sh
index 78845a3..8f114be 100755
--- a/reset-module.sh
+++ b/reset-module.sh
@@ -2,14 +2,18 @@ if [[ $UID != 0 ]]; then
echo "You must be root."
exit -1
fi
+
ifconfig wlan0 down
-systemctl stop dhcpcd.service
-systemctl stop wpa_supplicant@wlan0.service
-rmmod ath9k
-rmmod ath9k_common
-rmmod ath9k_hw
-modprobe ath9k
+
+/etc/init.d/dhcpcd stop
+/etc/init.d/wpa_supplicant stop
+
+rmmod iwldvm
+rmmod iwlwifi
+modprobe iwlwifi
+
iwconfig wlan0 power on
ifconfig wlan0 up
-systemctl restart dhcpcd.service
-systemctl restart wpa_supplicant@wlan0.service
+
+/etc/init.d/wpa_supplicant start
+/etc/init.d/dhcpcd start
diff --git a/spoof.sh b/spoof.sh
index bfb2df5..4645f52 100755
--- a/spoof.sh
+++ b/spoof.sh
@@ -7,14 +7,19 @@ if [[ $# -ne 4 ]]; then
exit -1
fi
-systemctl stop dhcpcd.service
-systemctl stop wpa_supplicant.service
+/etc/init.d/dhcpcd stop
+/etc/init.d/wpa_supplicant stop
+
ifconfig wlan0 down
macchanger -m $4 wlan0
ifconfig wlan0 $1 netmask $2
+
ip route del default
ip route add default via $3
+
echo nameserver 8.8.8.8 > /etc/resolv.conf
echo nameserver 8.8.4.4 >> /etc/resolv.conf
+
ifconfig wlan0 up
-systemctl start wpa_supplicant@wlan0.service
+
+/etc/init.d/wpa_supplicant start