diff options
author | Vasudev Kamath <kamathvasudev@gmail.com> | 2015-10-12 21:07:13 +0530 |
---|---|---|
committer | Vasudev Kamath <kamathvasudev@gmail.com> | 2015-10-12 21:19:50 +0530 |
commit | 3d87bd8072eab99b2c2dce01c251cd08f440fb1e (patch) | |
tree | 87769294206ef7d556aa4e3fc3df17251f3b08a5 | |
parent | aed440f5500b3841e87705afb1d128766c3ca6fa (diff) |
Wifi network start and stop scripts
This script is to be used by systemd for manually launching
wpa_supplicant. But as of now I don't use it as I use
network-manager/connman.
-rwxr-xr-x | start-network | 14 | ||||
-rwxr-xr-x | stop-network | 6 |
2 files changed, 20 insertions, 0 deletions
diff --git a/start-network b/start-network new file mode 100755 index 0000000..9b9212f --- /dev/null +++ b/start-network @@ -0,0 +1,14 @@ +#!/bin/sh + +INTERFACE="$1" + +# Set interface up +/sbin/ip link set $INTERFACE up + +# Launch wpa_supplicant in daemon mode +/sbin/wpa_supplicant -B -D nl80211,wext \ + -c/etc/wpa_supplicant/wpasupplicant.conf\ + -i$INTERFACE -ddd + +# Get the IP from router +/sbin/dhclient $INTERFACE diff --git a/stop-network b/stop-network new file mode 100755 index 0000000..294409c --- /dev/null +++ b/stop-network @@ -0,0 +1,6 @@ +#!/bin/sh + +INTERFACE="$1" + +/sbin/ip addr flush dev $INTERFACE +/sbin/ip link set $INTERFACE down |