immortalwrt/package/emortal/default-settings/files/99-default-settings
Tianling Shen f8f7f18387
default-settings: fix override user settings
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c90db07cf9)
2023-07-06 02:54:16 +08:00

32 lines
805 B
Bash
Executable File

#!/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].lang > "/dev/null"; then
uci -q set luci.main.lang="auto"
uci -q commit luci
uci -q set system.@imm_init[0].lang="1"
uci -q commit system
fi
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
uci -q set system.@imm_init[0].anon_mount="1"
uci -q commit system
fi
ln -sf "/sbin/ip" "/usr/bin/ip"
[ ! -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"
sed -i "/log-facility/d" "/etc/dnsmasq.conf"
echo "log-facility=/dev/null" >> "/etc/dnsmasq.conf"
rm -rf "/tmp/luci-modulecache"
rm -f "/tmp/luci-indexcache"
exit 0