🐶 Sync 2025-11-02 14:26:26
This commit is contained in:
14
luci-app-lucky/root/etc/uci-defaults/66_luci-lucky
Normal file
14
luci-app-lucky/root/etc/uci-defaults/66_luci-lucky
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@lucky[-1]
|
||||
add ucitrack lucky
|
||||
set ucitrack.@lucky[-1].init=lucky
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
chmod +x /usr/bin/luckyarch
|
||||
rm -f /tmp/luci-indexcache* 2>/dev/null
|
||||
rm -f /tmp/luci-modulecache/* 2>/dev/null # 针对OpenWrt 21.02+
|
||||
rm -f /tmp/luci-indexcache
|
||||
return 0
|
||||
14
luci-app-lucky/root/usr/bin/luckyarch
Normal file
14
luci-app-lucky/root/usr/bin/luckyarch
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
cputype=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
|
||||
[ -n "$(echo $cputype | grep -E "linux.*armv.*")" ] && cpucore="armv5"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*armv7.*")" ] && [ -n "$(cat /proc/cpuinfo | grep vfp)" ] && [ ! -d /jffs/clash ] && cpucore="armv7"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*aarch64.*|linux.*armv8.*")" ] && cpucore="arm64"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*86.*")" ] && cpucore="i386"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*86_64.*")" ] && cpucore="x86_64"
|
||||
if [ -n "$(echo $cputype | grep -E "linux.*mips.*")" ];then
|
||||
mipstype=$(echo -n I | hexdump -o 2>/dev/null | awk '{ print substr($2,6,1); exit}') #通过判断大小端判断mips或mipsle
|
||||
[ "$mipstype" = "0" ] && cpucore="mips_softfloat" || cpucore="mipsle_softfloat"
|
||||
fi
|
||||
|
||||
echo $cpucore
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"admin/services/lucky": {
|
||||
"title": "Lucky",
|
||||
"order": 60,
|
||||
"action": {
|
||||
"type": "firstchild",
|
||||
"preferred": "setting"
|
||||
},
|
||||
"depends": {
|
||||
"acl": ["luci-app-lucky"],
|
||||
"uci": {"lucky": true}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
luci-app-lucky/root/usr/share/rpcd/acl.d/luci-app-lucky.json
Normal file
14
luci-app-lucky/root/usr/share/rpcd/acl.d/luci-app-lucky.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"luci-app-lucky": {
|
||||
"description": "Grant UCI access for luci-app-lucky",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"service": [ "list" ]
|
||||
},
|
||||
"uci": [ "lucky" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "lucky" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user