diff --git a/conf/etc/hostapd.conf b/conf/etc/hostapd.conf index e00087c..32944e4 100644 --- a/conf/etc/hostapd.conf +++ b/conf/etc/hostapd.conf @@ -1,4 +1,4 @@ -interface=wlan0 +interface=ap0 hw_mode=g channel=1 wmm_enabled=1 diff --git a/conf/etc/init.d/S05wlan-interfaces b/conf/etc/init.d/S05wlan-interfaces new file mode 100644 index 0000000..438533d --- /dev/null +++ b/conf/etc/init.d/S05wlan-interfaces @@ -0,0 +1,16 @@ +#!/bin/sh + +case "$1" in + start) + printf "Starting wireless device: " + iw dev wlan0 del + iw phy phy0 interface add ap0 type __ap + iw phy phy0 interface add client0 type station + [ $? = 0 ] && echo "OK" || echo "FAIL" + ;; + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit 0 diff --git a/conf/etc/init.d/S80dhcp-server b/conf/etc/init.d/S80dhcp-server index 7a215f1..36eb596 100755 --- a/conf/etc/init.d/S80dhcp-server +++ b/conf/etc/init.d/S80dhcp-server @@ -3,7 +3,7 @@ # $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $ # -INTERFACES="wlan0" +INTERFACES="ap0" OPTIONS="" NAME="dhcpd" diff --git a/conf/etc/network/interfaces b/conf/etc/network/interfaces index 4337aca..22bcd98 100644 --- a/conf/etc/network/interfaces +++ b/conf/etc/network/interfaces @@ -4,7 +4,10 @@ iface lo inet loopback auto eth0 iface eth0 inet dhcp -auto wlan0 -iface wlan0 inet static +auto ap0 + iface ap0 inet static address 192.168.77.1 netmask 255.255.255.0 + +auto client0 + iface client0 inet dhcp diff --git a/conf/etc/sudoers b/conf/etc/sudoers index 357e8f7..5562bb6 100644 --- a/conf/etc/sudoers +++ b/conf/etc/sudoers @@ -10,4 +10,4 @@ Defaults insults Defaults log_input,log_output www-data ALL=(admin) NOPASSWD: /bin/sh /update.sh -upgrade ALL=(root) NOPASSWD: /usr/sbin/iw wlan0 scan, /sbin/iw wlan0 link, /bin/cat /etc/wpa_supplicant.conf, /bin/sh /wifi/connect.sh *, /bin/sh /wifi/disconnect.sh +upgrade ALL=(root) NOPASSWD: /usr/sbin/iw client0 scan, /sbin/iw client0 link, /bin/cat /etc/wpa_supplicant.conf, /bin/sh /wifi/connect.sh *, /bin/sh /wifi/disconnect.sh diff --git a/conf/wifi/connect.sh b/conf/wifi/connect.sh index 924d335..67a13cf 100755 --- a/conf/wifi/connect.sh +++ b/conf/wifi/connect.sh @@ -6,5 +6,4 @@ if [ "$#" -ne 2 ]; then fi /usr/bin/wpa_passphrase "$1" "$2" > /etc/wpa_supplicant.conf -/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -/usr/sbin/dhclient wlan0 +/usr/sbin/wpa_supplicant -B -i client0 -c /etc/wpa_supplicant.conf diff --git a/conf/wifi/disconnect.sh b/conf/wifi/disconnect.sh index d950474..023132a 100755 --- a/conf/wifi/disconnect.sh +++ b/conf/wifi/disconnect.sh @@ -1,3 +1,3 @@ #!/bin/sh -/usr/sbin/wpa_cli -i wlan0 terminate +/usr/sbin/wpa_cli -i client0 terminate diff --git a/keygen/keygen.c b/keygen/keygen.c index ef0e319..a14115a 100644 --- a/keygen/keygen.c +++ b/keygen/keygen.c @@ -151,7 +151,7 @@ char *get_mac() { FILE * fp; char *mac = malloc(18* sizeof(char)); - fp = fopen("/sys/class/net/wlan0/address", "r"); + fp = fopen("/sys/class/net/ap0/address", "r"); fgets(mac, 17, fp); fclose(fp); return mac; @@ -276,4 +276,4 @@ int main() gen_key(mac, serial); return 0; -} \ No newline at end of file +}