summarylogtreecommitdiffstats
path: root/wifi.hook
diff options
context:
space:
mode:
authorAndreas2019-07-24 19:56:57 +0200
committerAndreas2019-07-24 19:56:57 +0200
commitc28673eb9d6cfb1a52bad8d23eb8f2b3408add9d (patch)
treebdf9a3aff1ed1be92a457840a913a334e63df078 /wifi.hook
downloadaur-c28673eb9d6cfb1a52bad8d23eb8f2b3408add9d.tar.gz
initial version
Diffstat (limited to 'wifi.hook')
-rw-r--r--wifi.hook31
1 files changed, 31 insertions, 0 deletions
diff --git a/wifi.hook b/wifi.hook
new file mode 100644
index 000000000000..2813af145793
--- /dev/null
+++ b/wifi.hook
@@ -0,0 +1,31 @@
+#!/usr/bin/ash
+
+run_hook ()
+{
+ # sleep a couple of seconds so wlan0 is setup by kernel
+ sleep 3
+
+ echo "Starting wifi"
+
+ # set wlan0 to up
+ ip link set wlan0 up
+
+ # assocciate with wifi network
+ wpa_supplicant -B -D nl80211,wext -i wlan0 -c /etc/wpa_supplicant/initcpio.conf
+
+ # sleep a couple of seconds so that wpa_supplicant finishes connecting
+ sleep 5
+
+ # wlan0 should now be connected and ready to be assigned an ip by the net hook
+}
+
+run_cleanuphook ()
+{
+ # kill wpa_supplicant running in the background
+ killall wpa_supplicant
+
+ # set wlan0 link down
+ ip link set wlan0 down
+
+ # wlan0 should now be fully disconnected from the wifi network
+}