summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-09-12 20:54:49 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-09-12 20:54:49 -0400
commit6c78ba07464734290f4aec745d68d7a170dd6545 (patch)
tree5a9e6ba73f4e4ef61b5bd57f67c9efc9f64b456b
downloadwifi-monitoring-scripts-6c78ba07464734290f4aec745d68d7a170dd6545.tar.xz
wifi-monitoring-scripts-6c78ba07464734290f4aec745d68d7a170dd6545.zip
Initial commit.
-rwxr-xr-xmac.sh16
-rwxr-xr-xmonitor.sh15
-rwxr-xr-xnormal.sh8
3 files changed, 39 insertions, 0 deletions
diff --git a/mac.sh b/mac.sh
new file mode 100755
index 0000000..3f1d397
--- /dev/null
+++ b/mac.sh
@@ -0,0 +1,16 @@
+if [[ $UID != 0 ]]; then
+ echo "You must be root."
+ exit -1
+fi
+if [[ $# -ne 1 ]]; then
+ echo "You must provide a mac address you'd like to change to."
+ exit -1
+fi
+
+systemctl stop dhcpcd.service
+systemctl stop wpa_supplicant.service
+ifconfig wlan0 down
+macchanger -m $1 wlan0
+ifconfig wlan0 up
+systemctl start dhcpcd.service
+systemctl start wpa_supplicant@wlan0.service
diff --git a/monitor.sh b/monitor.sh
new file mode 100755
index 0000000..c239351
--- /dev/null
+++ b/monitor.sh
@@ -0,0 +1,15 @@
+if [[ $UID != 0 ]]; then
+ echo "You must be root."
+ exit -1
+fi
+systemctl stop dhcpcd.service
+systemctl stop wpa_supplicant.service
+if [ $# -eq 1 ]; then
+ ifconfig wlan0 down
+ iwconfig wlan0 mode managed
+ ifconfig wlan0 up
+ ifconfig wlan0 channel $1
+fi
+ifconfig wlan0 down
+iwconfig wlan0 mode monitor
+ifconfig wlan0 up
diff --git a/normal.sh b/normal.sh
new file mode 100755
index 0000000..13970aa
--- /dev/null
+++ b/normal.sh
@@ -0,0 +1,8 @@
+if [[ $UID != 0 ]]; then
+ echo "You must be root."
+ exit -1
+fi
+ifconfig wlan0 down
+ifconfig wlan0 up
+systemctl start dhcpcd.service
+systemctl start wpa_supplicant@wlan0.service