small-package/diy/zzz-default-settings

82 lines
2.9 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
touch /etc/crontabs/root
uci set luci.main.lang=zh_cn
#设置默认主题
#uci set luci.main.mediaurlbase=/luci-static/bootstrap_mod
uci commit luci
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci commit system
uci set fstab.@global[0].anon_mount=1
uci commit fstab
ln -sf /sbin/ip /usr/bin/ip
sed -i '/lienol/d' /etc/opkg/distfeeds.conf
#sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
#sed -i 's/http/https/g' /etc/opkg/distfeeds.conf
sed -i "s/# //g" /etc/opkg/distfeeds.conf
#sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
#uci set dhcp.lan.ra='server'
#uci set dhcp.lan.dhcpv6='server'
#uci set dhcp.lan.ra_management='1'
#uci set dhcp.lan.ra_default='1'
#uci set dhcp.@dnsmasq[0].localservice=0
#uci set dhcp.@dnsmasq[0].nonwildcard=0
#uci commit dhcp
#设置IP
uci set network.lan.ipaddr='192.168.1.252' # 默认IP地址
uci set network.lan.proto='static' # 静态IP
uci set network.lan.type='bridge' # 接口类型:桥接
uci set network.lan.ifname='eth0' # 网络端口:默认 eth0第一个网口
uci set network.lan.netmask='255.255.255.0' # 子网掩码
uci set network.lan.gateway='192.168.1.251' # 默认网关地址主路由IP
uci set network.lan.dns='192.168.1.251 223.5.5.5 119.29.29.29' # 默认上游 DNS 地址
uci commit network
#DNS重定向
sed -i '/REDIRECT --to-ports 53/d' /etc/firewall.user
echo "# iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
sed -i '/option disabled/d' /etc/config/wireless
sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
date=`date +%m.%d`
date1=`date +%h`
sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release
echo "DISTRIB_REVISION='v$date'" >> /etc/openwrt_release
sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release
echo "DISTRIB_DESCRIPTION='Openwrt '" >> /etc/openwrt_release
sed -i 's/LuCI Master/kenzo/g' /usr/lib/lua/luci/version.lua
sed -i 's/LuCI openwrt-18.06 branch/kenzo/g' /usr/lib/lua/luci/version.lua
sed -i 's/LuCI 17.01 Lienol/kenzo/g' /usr/lib/lua/luci/version.lua
sed -i 's/LuCI openwrt-21.02 branch/kenzo/g' /usr/lib/lua/luci/version.lua
sed -i '/luciversion/d' /usr/lib/lua/luci/version.lua
echo 'luciversion = "$date1"' >> /usr/lib/lua/luci/version.lua
# 删除状态页不需显示的
rm -rf /usr/lib/lua/luci/view/admin_status/index
#mv -f /usr/lib/lua/luci/view/admin_status/index /usr/lib/lua/luci/view/admin_status/index_backup 2>/dev/null
#禁用某些可能会自启动且用不上的依赖包服务
/etc/init.d/php7-fastcgi disable 2>/dev/null
/etc/init.d/php7-fpm disable 2>/dev/null
/etc/init.d/softethervpnbridge disable 2>/dev/null
/etc/init.d/softethervpnserver disable 2>/dev/null
/etc/init.d/softethervpnclient disable 2>/dev/null
/etc/init.d/haproxy disable 2>/dev/null
/etc/init.d/kcptun disable 2>/dev/null
rm -rf /tmp/luci-*cache
exit 0