Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mgqnfoqv7k2w
AutoBuildImmortalWrt
Commits
1d1f9385
Unverified
Commit
1d1f9385
authored
Jan 08, 2025
by
wukongdaily
Committed by
GitHub
Jan 08, 2025
Browse files
增加预设置宽带拨号功能(glinet)
parent
ce676a0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
8 deletions
+63
-8
.github/workflows/build-glinet-23.05.4.yml
.github/workflows/build-glinet-23.05.4.yml
+44
-3
glinet/99-custom.sh
glinet/99-custom.sh
+19
-5
No files found.
.github/workflows/build-glinet-23.05.4.yml
View file @
1d1f9385
...
...
@@ -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 }}
glinet/99-custom.sh
View file @
1d1f9385
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment