aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/soloscli/Makefile2
-rw-r--r--package/soloscli/files/etc/hotplug.d/atm/15-solos-init26
-rw-r--r--package/soloscli/files/etc/uci-default/solos15
3 files changed, 43 insertions, 0 deletions
diff --git a/package/soloscli/Makefile b/package/soloscli/Makefile
index 611dbcc08f..1c2d998090 100644
--- a/package/soloscli/Makefile
+++ b/package/soloscli/Makefile
@@ -37,6 +37,8 @@ endef
define Package/soloscli/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/soloscli/soloscli $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
+ $(INSTALL_DATA) ./files/etc/hotplug.d/atm/15-solos-init $(1)/etc/hotplug.d/atm/
endef
$(eval $(call BuildPackage,soloscli))
diff --git a/package/soloscli/files/etc/hotplug.d/atm/15-solos-init b/package/soloscli/files/etc/hotplug.d/atm/15-solos-init
new file mode 100644
index 0000000000..36d13ea5a0
--- /dev/null
+++ b/package/soloscli/files/etc/hotplug.d/atm/15-solos-init
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+dialog() {
+ local tag="$(echo "$1" | cut -d= -f1)"
+ local value="$(echo "$1" | cut -d= -f2-)"
+ local response
+
+ response="$(soloscli -s "$port" "$tag" "$value")"
+ [ $? -ne 0 ] && {
+ logger "soloscli($port): $tag '$value' returns $response"
+ }
+}
+
+if [ "$ACTION" = "add" ]; then
+ include /lib/network
+ scan_interfaces
+
+ case $DEVICENAME in
+ solos-pci[0-3])
+ port="${DEVICENAME#solos-pci}"
+ device="solos${port}"
+
+ config_list_foreach wan "$device" dialog
+ ;;
+ esac
+fi
diff --git a/package/soloscli/files/etc/uci-default/solos b/package/soloscli/files/etc/uci-default/solos
new file mode 100644
index 0000000000..7f69da62c6
--- /dev/null
+++ b/package/soloscli/files/etc/uci-default/solos
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+uci batch <<__EOF__
+
+delete network.wan.solos0
+
+add_list network.wan.solos0="ActivateLine=Abort"
+add_list network.wan.solos0="Retrain=EnableAll"
+add_list network.wan.solos0="DetectNoise=Enable"
+add_list network.wan.solos0="BisMCapability=Disable"
+add_list network.wan.solos0="BisACapability=Disable"
+add_list network.wan.solos0="ActivateLine=Start"
+
+commit network
+__EOF__