Unverified Commit 1d1f9385 authored by wukongdaily's avatar wukongdaily Committed by GitHub
Browse files

增加预设置宽带拨号功能(glinet)

parent ce676a0c
......@@ -11,6 +11,7 @@ on:
- glinet_gl-mt3000
- glinet_gl-mt2500
- glinet_gl-mt6000
- glinet_gl-b2200
default: glinet_gl-mt3000
include_docker:
description: |
......@@ -21,6 +22,20 @@ on:
options:
- 'yes'
- 'no'
enable_pppoe:
description: "是否配置PPPoE拨号信息?"
required: true
default: 'no'
type: choice
options:
- 'yes'
- 'no'
pppoe_account:
description: "宽带账号 (若启用PPPoE)"
required: false
pppoe_password:
description: "宽带密码 (若启用PPPoE)"
required: false
jobs:
......@@ -35,10 +50,36 @@ jobs:
run: |
chmod +x ${{ github.workspace }}/mediatek-filogic/build.sh
- name: Validate PPPoE Inputs
run: |
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then
echo "Error: PPPoE account and password must be provided when PPPoE is enabled!"
exit 1
fi
fi
- name: Validate Inputs and Set Environment
env:
ENABLE_PPPOE: ${{ inputs.enable_pppoe }}
PPPOE_ACCOUNT: ${{ inputs.pppoe_account }}
PPPOE_PASSWORD: ${{ inputs.pppoe_password }}
run: |
echo "ENABLE_PPPOE=$ENABLE_PPPOE"
echo "PPPOE_ACCOUNT=$PPPOE_ACCOUNT"
echo "PPPOE_PASSWORD=$PPPOE_PASSWORD"
- name: Build Gl-iNet ImmpotalWrt 23.05.4
run: |
profiles="${{ github.event.inputs.profile }}"
include_docker="${{ github.event.inputs.include_docker }}"
if [ "$profiles" = "glinet_gl-b2200" ]; then
tag=ipq40xx-generic-openwrt-23.05.4
echo "platform=ipq40xx/generic" >> $GITHUB_ENV
else
tag=mediatek-filogic-openwrt-23.05.4
echo "platform=mediatek/filogic" >> $GITHUB_ENV
fi
IFS=',' read -r -a profile_array <<< "$profiles"
......@@ -52,12 +93,12 @@ jobs:
-v "${{ github.workspace }}/mediatek-filogic/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
immortalwrt/imagebuilder:mediatek-filogic-openwrt-23.05.4 /bin/bash /home/build/immortalwrt/build.sh
immortalwrt/imagebuilder:$tag /bin/bash /home/build/immortalwrt/build.sh
done
- name: Generate Firmware SHA-256
run: |
cp ${{ github.workspace }}/bin/targets/mediatek/filogic/*.bin ${{ github.workspace }}
cp ${{ github.workspace }}/bin/targets/${{ env.platform }}/*.bin ${{ github.workspace }}
for file in *.bin; do
sha256sum "$file" > "$file.sha256"
sha256sum -c "$file.sha256"
......@@ -92,4 +133,4 @@ jobs:
${{ github.workspace }}/*.sha256
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
......@@ -8,8 +8,7 @@ uci add dhcp domain
uci set "dhcp.@domain[-1].name=time.android.com"
uci set "dhcp.@domain[-1].ip=203.107.6.88"
# 根据网卡数量配置网络
# 计算网卡数量
count=0
for iface in /sys/class/net/*; do
iface_name=$(basename "$iface")
......@@ -21,10 +20,25 @@ done
# 网络设置
if [ "$count" -eq 1 ]; then
uci set network.lan.proto='dhcp'
# 单网口设备 NAS模式
uci set network.lan.proto='dhcp'
elif [ "$count" -gt 1 ]; then
uci set network.lan.ipaddr='192.168.8.1'
fi
# 多网口设备
uci set network.lan.ipaddr='192.168.8.1'
# 判断是否启用 PPPoE
if [[ "$ENABLE_PPPOE" == "yes" ]]; then
echo "PPPoE is enabled."
# 设置拨号信息
uci set network.wan.proto='pppoe'
uci set network.wan.username=$PPPOE_ACCOUNT
uci set network.wan.password=$PPPOE_PASSWORD
uci set network.wan.peerdns='1'
uci set network.wan.auto='1'
echo "PPPoE configuration completed successfully."
else
echo "PPPoE is not enabled. Skipping configuration."
fi
fi
# 设置所有网口可访问网页终端
uci delete ttyd.@ttyd[0].interface
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment