default-settings 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/sh
  2. ln -sf /sbin/ip /usr/bin/ip
  3. sed -i '/openwrt_packages2/d' /etc/opkg/customfeeds.conf
  4. sed -i '/openwrt_base2/d' /etc/opkg/customfeeds.conf
  5. sed -i '/openwrt_custom/d' /etc/opkg/customfeeds.conf
  6. sed -i '/openwrt_custom/d' /etc/opkg/distfeeds.conf
  7. sed -i 's/downloads.openwrt.org/op.supes.top/g' /etc/opkg/distfeeds.conf
  8. sed -i 's/http:/https:/g' /etc/opkg/distfeeds.conf
  9. sed -i "s/# //g" /etc/opkg/distfeeds.conf
  10. grep -q log-facility /etc/dnsmasq.conf ||
  11. echo "log-facility=/dev/null" >> /etc/dnsmasq.conf
  12. grep -q /etc/dnsmasq.d /etc/dnsmasq.conf ||
  13. echo "conf-dir=/etc/dnsmasq.d" >> /etc/dnsmasq.conf
  14. sed -i '/profile.d/d' /lib/upgrade/keep.d/base-files
  15. rm -rf /tmp/luci-*
  16. sed -i '/S99opkg/d' /etc/crontabs/root
  17. echo "0 4 * * * sh /etc/rc.d/S99opkg >/dev/null 2>&1" >> /etc/crontabs/root
  18. uci set system.@rngd[0].enabled="1"
  19. uci commit system
  20. uci set uhttpd.main.rfc1918_filter=0
  21. uci set uhttpd.main.redirect_https=0
  22. uci commit uhttpd
  23. if [ ! -f /etc/config/placeholder ]; then
  24. if [ $(uci get network.wan.ipv6) == 0 ]; then
  25. uci set dhcp.@dnsmasq[0].filter_aaaa='1'
  26. uci commit dhcp
  27. else
  28. uci set dhcp.@dnsmasq[0].filter_aaaa='0'
  29. uci commit dhcp
  30. uci set turboacc.config.sfe_ipv6='1'
  31. uci commit turboacc
  32. fi
  33. uci set luci.main.lang=auto
  34. uci set luci.main.mediaurlbase=/luci-static/edge
  35. uci commit luci
  36. uci set system.@system[0].timezone=CST-8
  37. uci set system.@system[0].zonename=Asia/Shanghai
  38. uci commit system
  39. uci set fstab.@global[0].anon_mount=1
  40. uci commit fstab
  41. sed -i 's/root:.*/root:$1$tTPCBw1t$ldzfp37h5lSpO9VXk4uUE\/:18336:0:99999:7:::/g' /etc/shadow
  42. uci set network.lan.ipaddr="10.0.0.1"
  43. uci set network.wan.proto=pppoe
  44. uci commit network
  45. uci set network.@globals[0].packet_steering=1
  46. uci commit network
  47. uci set dhcp.@dnsmasq[0].dns_redirect='1'
  48. uci set dhcp.dnsmasq[0].allservers='1'
  49. uci set dhcp.lan.force='1'
  50. uci set dhcp.@dnsmasq[0].cachesize='1500'
  51. uci commit dhcp
  52. fi
  53. cp -R /www/cgi-bin/* /www/
  54. find /www -type d -exec chmod 755 {} \;
  55. chmod +x /www/luci
  56. sed -i "s/git-.*-\(.*\)/git-\1/g" /usr/lib/lua/luci/version.lua
  57. grep -q reboot /etc/shinit ||
  58. sed -i '$a alias reboot="(/sbin/reboot &);sleep 3;/sbin/reboot -f"\nalias /sbin/reboot="(/sbin/reboot &);sleep 3;/sbin/reboot -f"' /etc/shinit
  59. ln -s /sbin/poweroff /sbin/shutdown