default-settings: fix override user settings

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c90db07cf9)
This commit is contained in:
Tianling Shen 2023-07-06 01:12:57 +08:00
parent cc1d07f615
commit f8f7f18387
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 54 additions and 37 deletions

View File

@ -1,28 +1,31 @@
#!/bin/sh #!/bin/sh
uci set luci.main.lang=auto uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
uci commit luci
uci set fstab.@global[0].anon_mount=1 if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then
uci commit fstab uci -q set luci.main.lang="auto"
uci -q commit luci
rm -f /www/luci-static/resources/view/status/include/50_dsl.js uci -q set system.@imm_init[0].lang="1"
rm -f /www/luci-static/resources/view/status/include/70_ddns.js uci -q commit system
rm -f /www/luci-static/resources/view/status/include/80_minidlna.js fi
rm -f /www/luci-static/resources/view/status/include/80_upnp.js
ln -sf /sbin/ip /usr/bin/ip if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then
uci -q set fstab.@global[0].anon_mount="1"
uci -q commit fstab
[ -f '/bin/bash' ] && sed -i 's|root:x:0:0:root:/root:/bin/ash|root:x:0:0:root:/root:/bin/bash|g' /etc/passwd uci -q set system.@imm_init[0].anon_mount="1"
uci -q commit system
fi
sed -i '/option disabled/d' /etc/config/wireless ln -sf "/sbin/ip" "/usr/bin/ip"
sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
sed -i '/log-facility/d' /etc/dnsmasq.conf [ ! -e "/bin/bash" ] || sed -i "s|root:x:0:0:root:/root:/bin/ash|root:x:0:0:root:/root:/bin/bash|g" "/etc/passwd"
echo 'log-facility=/dev/null' >> /etc/dnsmasq.conf
rm -rf /tmp/luci-modulecache/ sed -i "/log-facility/d" "/etc/dnsmasq.conf"
rm -f /tmp/luci-indexcache echo "log-facility=/dev/null" >> "/etc/dnsmasq.conf"
rm -rf "/tmp/luci-modulecache"
rm -f "/tmp/luci-indexcache"
exit 0 exit 0

View File

@ -1,18 +1,23 @@
#!/bin/sh #!/bin/sh
uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
if ! uci -q get system.@imm_init[0].system_chn > "/dev/null"; then
uci -q batch <<-EOF uci -q batch <<-EOF
set system.@system[0].timezone='CST-8' set system.@system[0].timezone="CST-8"
set system.@system[0].zonename='Asia/Shanghai' set system.@system[0].zonename="Asia/Shanghai"
delete system.ntp.server delete system.ntp.server
add_list system.ntp.server='ntp.tencent.com' add_list system.ntp.server="ntp.tencent.com"
add_list system.ntp.server='ntp1.aliyun.com' add_list system.ntp.server="ntp1.aliyun.com"
add_list system.ntp.server='ntp.ntsc.ac.cn' add_list system.ntp.server="ntp.ntsc.ac.cn"
add_list system.ntp.server='cn.ntp.org.cn' add_list system.ntp.server="cn.ntp.org.cn"
set system.@imm_init[0].system_chn="1"
commit system commit system
EOF EOF
fi
sed -i 's,downloads.immortalwrt.org,mirrors.vsean.net/openwrt,g' /etc/opkg/distfeeds.conf sed -i.bak "s,downloads.immortalwrt.org,mirrors.vsean.net/openwrt,g" "/etc/opkg/distfeeds.conf"
exit 0 exit 0

View File

@ -1,12 +1,15 @@
#!/bin/sh #!/bin/sh
. /lib/functions.sh . /lib/functions.sh
if [ "$ACTION" != "ifup" ]; then if [ "$ACTION" != "ifup" ]; then
exit exit
fi fi
config_load network config_load network
config_get tunnelid $INTERFACE tunnelid config_get tunnelid "$INTERFACE" tunnelid
config_get username $INTERFACE username config_get username "$INTERFACE" username
config_get password $INTERFACE password config_get password "$INTERFACE" password
if [ "$tunnelid" != "" ]; then if [ "$tunnelid" != "" ]; then
wget -O - https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid wget -O - "https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid"
fi fi

View File

@ -1,9 +1,15 @@
#!/bin/sh #!/bin/sh
uci set dhcp.lan.ra='hybrid' uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
uci set dhcp.lan.ndp='hybrid' uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0
uci set dhcp.lan.dhcpv6='hybrid'
uci set dhcp.lan.ra_management='1' uci -q set dhcp.lan.ra="hybrid"
uci commit dhcp uci -q set dhcp.lan.ndp="hybrid"
uci -q set dhcp.lan.dhcpv6="hybrid"
uci -q set dhcp.lan.ra_management="1"
uci -q commit dhcp
uci -q set system.@imm_init[0].ipv6="1"
uci -q commit system
exit 0 exit 0