hnetd: Adding wifi autoconf PoC
authorOryon <pierre@darou.fr>
Fri, 21 Aug 2015 12:12:23 +0000 (05:12 -0700)
committerOryon <pierre@darou.fr>
Fri, 21 Aug 2015 12:12:23 +0000 (05:12 -0700)
hnetd/Makefile
hnetd/files/hnet.config
hnetd/files/hnetd.init

index dbeb586edb7b7b6faaec31f6b721feef40780505..896d848a1a70d5a13df79527ae5cf52a62649a87 100644 (file)
@@ -7,8 +7,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hnetd
-PKG_SOURCE_VERSION:=b5a03142135c9ab2680027d1fd8c149d2c46e74b
-PKG_VERSION:=2015-08-18-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=345fb74504249cee5d02b2349ccaaef118523118
+PKG_VERSION:=2015-08-21-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -121,6 +121,7 @@ define Package/hnetd-$(BUILD_VARIANT)/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) ./files/hnetd.defaults $(1)/etc/uci-defaults/x-hnetd.defaults
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/multicast.script $(1)/usr/sbin/hnet-multicast
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/autowifi.script $(1)/usr/sbin/autowifi
 endef
 
 define Package/hnet-full/install
index 6ac396f769a99922e50e3a2c49369071004a671d..aba765f734529da7d03f9828195134377fbbcf2e 100644 (file)
@@ -18,3 +18,11 @@ config pa pa
 config sd sd
 #      option router_name openwrt
 #      option domain_name home.
+
+
+# Wifi allows for very basic wifi autoconfiguration
+# Warning: This feature is unstable
+config wifi wifi
+#      option enable 0
+#       option ssid ssidtest
+#       option password test
index c4419eed4473cbe6cd57a6d275117f14c8a8cf23..742de48fdb7d0266f610cb6612136a0b406816cb 100644 (file)
@@ -15,6 +15,7 @@ OHP_BINARY=/usr/sbin/ohybridproxy
 PCP_SCRIPT=/usr/sbin/hnetd-pcp-script
 PCP_BINARY=/usr/sbin/minimalist-pcproxy
 MULTICAST_SCRIPT=/usr/sbin/hnet-multicast
+WIFI_SCRIPT=/usr/sbin/autowifi
 
 start_service() {
     . /lib/functions.sh
@@ -45,6 +46,17 @@ start_service() {
         $MULTICAST_SCRIPT status && procd_append_param command -M "$MULTICAST_SCRIPT"
     fi
 
+    config_get enableval wifi enable
+    if [ -f "$WIFI_SCRIPT" -a "$enableval" = "1" ]; then
+        wifiopt=$WIFI_SCRIPT
+        config_get ssidval wifi ssid
+        config_get passval wifi password
+        if [ -n "$ssidval" -a -n "$passval"  ]; then
+            wifiopt=${wifiopt},${ssidval}:${passval}
+        fi
+        procd_append_param command -w "$wifiopt"
+    fi
+
     # Enable PCP, if it's present
     if [ -f $PCP_BINARY -a -f $PCP_SCRIPT ]
     then