From a8a47454d29a64c38635308405052f0e4253e534 Mon Sep 17 00:00:00 2001 From: Ekko Date: Fri, 11 Oct 2024 23:45:31 +0800 Subject: [PATCH] refactor: split network to two module cause some use do not want modify lan ip and PPPoE at same time --- build.sh | 2 +- modules/lan/example.env | 1 + modules/lan/files/etc/uci-defaults/89-network | 7 +++++++ modules/network/example.env | 3 --- modules/pppoe/example.env | 2 ++ .../{network => pppoe}/files/etc/uci-defaults/89-network | 7 ------- 6 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 modules/lan/example.env create mode 100644 modules/lan/files/etc/uci-defaults/89-network delete mode 100644 modules/network/example.env create mode 100644 modules/pppoe/example.env rename modules/{network => pppoe}/files/etc/uci-defaults/89-network (69%) diff --git a/build.sh b/build.sh index 73b76d1..b0e0f12 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -default_modules="add-all-device-to-lan add-feed-key add-feed ib argon base network opkg-mirror prefer-ipv6-settings statistics system tools" +default_modules="add-all-device-to-lan add-feed-key add-feed ib argon base opkg-mirror prefer-ipv6-settings statistics system tools" echo "Default modules: $default_modules" diff --git a/modules/lan/example.env b/modules/lan/example.env new file mode 100644 index 0000000..cf9baf9 --- /dev/null +++ b/modules/lan/example.env @@ -0,0 +1 @@ +LAN_IP=192.168.2.1 \ No newline at end of file diff --git a/modules/lan/files/etc/uci-defaults/89-network b/modules/lan/files/etc/uci-defaults/89-network new file mode 100644 index 0000000..c82a507 --- /dev/null +++ b/modules/lan/files/etc/uci-defaults/89-network @@ -0,0 +1,7 @@ + +uci batch << EOF + +set network.lan.ipaddr='$LAN_IP' + +commit +EOF \ No newline at end of file diff --git a/modules/network/example.env b/modules/network/example.env deleted file mode 100644 index 83746c7..0000000 --- a/modules/network/example.env +++ /dev/null @@ -1,3 +0,0 @@ -PPPOE_USERNAME= -PPPOE_PASSWORD= -LAN_IP=192.168.2.1 \ No newline at end of file diff --git a/modules/pppoe/example.env b/modules/pppoe/example.env new file mode 100644 index 0000000..937ecca --- /dev/null +++ b/modules/pppoe/example.env @@ -0,0 +1,2 @@ +PPPOE_USERNAME= +PPPOE_PASSWORD= \ No newline at end of file diff --git a/modules/network/files/etc/uci-defaults/89-network b/modules/pppoe/files/etc/uci-defaults/89-network similarity index 69% rename from modules/network/files/etc/uci-defaults/89-network rename to modules/pppoe/files/etc/uci-defaults/89-network index ef5c84e..4a8e364 100644 --- a/modules/network/files/etc/uci-defaults/89-network +++ b/modules/pppoe/files/etc/uci-defaults/89-network @@ -5,10 +5,3 @@ set network.wan.password='$PPPOE_PASSWORD' commit EOF - -uci batch << EOF - -set network.lan.ipaddr='$LAN_IP' - -commit -EOF \ No newline at end of file