summaryrefslogtreecommitdiff
path: root/net-profile
diff options
context:
space:
mode:
Diffstat (limited to 'net-profile')
-rwxr-xr-xnet-profile20
1 files changed, 20 insertions, 0 deletions
diff --git a/net-profile b/net-profile
new file mode 100755
index 0000000..57c278a
--- /dev/null
+++ b/net-profile
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+DEV=`ls -1 /sys/class/net | grep wlan`
+
+setup_wifi()
+{
+ sudo wpa_supplicant -D wext -i $DEV -c ~/.net_profiles/$1.conf &>/tmp/wpa_supplicant.log &
+ sudo /etc/init.d/dhcpcd start
+ sleep 30
+ sudo rc-config start ntp-client
+}
+
+if [ ! -f ~/.net_profiles/$1.conf ]; then
+ echo "no such profile"
+ exit
+fi
+
+setup_wifi $1
+
+