diff --git a/package/emortal/default-settings/files/99-default-settings b/package/emortal/default-settings/files/99-default-settings index ae9ee0ae00..d13dfedb87 100755 --- a/package/emortal/default-settings/files/99-default-settings +++ b/package/emortal/default-settings/files/99-default-settings @@ -1,28 +1,31 @@ #!/bin/sh -uci set luci.main.lang=auto -uci commit luci +uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" -uci set fstab.@global[0].anon_mount=1 -uci commit fstab +if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then + uci -q set luci.main.lang="auto" + uci -q commit luci -rm -f /www/luci-static/resources/view/status/include/50_dsl.js -rm -f /www/luci-static/resources/view/status/include/70_ddns.js -rm -f /www/luci-static/resources/view/status/include/80_minidlna.js -rm -f /www/luci-static/resources/view/status/include/80_upnp.js + uci -q set system.@imm_init[0].lang="1" + uci -q commit system +fi -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 -sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh -wifi up +ln -sf "/sbin/ip" "/usr/bin/ip" -sed -i '/log-facility/d' /etc/dnsmasq.conf -echo 'log-facility=/dev/null' >> /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" -rm -rf /tmp/luci-modulecache/ -rm -f /tmp/luci-indexcache +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 diff --git a/package/emortal/default-settings/files/99-default-settings-chinese b/package/emortal/default-settings/files/99-default-settings-chinese index c87e3ed8c4..dd24bda0f6 100755 --- a/package/emortal/default-settings/files/99-default-settings-chinese +++ b/package/emortal/default-settings/files/99-default-settings-chinese @@ -1,17 +1,23 @@ #!/bin/sh -uci -q batch <<-EOF - set system.@system[0].timezone='CST-8' - set system.@system[0].zonename='Asia/Shanghai' +uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" - delete system.ntp.server - add_list system.ntp.server='ntp.tencent.com' - add_list system.ntp.server='ntp1.aliyun.com' - add_list system.ntp.server='ntp.ntsc.ac.cn' - add_list system.ntp.server='cn.ntp.org.cn' -EOF -uci commit system +if ! uci -q get system.@imm_init[0].system_chn > "/dev/null"; then + uci -q batch <<-EOF + set system.@system[0].timezone="CST-8" + set system.@system[0].zonename="Asia/Shanghai" -sed -i 's,downloads.immortalwrt.org,mirrors.vsean.net/openwrt,g' /etc/opkg/distfeeds.conf + delete system.ntp.server + add_list system.ntp.server="ntp.tencent.com" + add_list system.ntp.server="ntp1.aliyun.com" + add_list system.ntp.server="ntp.ntsc.ac.cn" + add_list system.ntp.server="cn.ntp.org.cn" + + set system.@imm_init[0].system_chn="1" + commit system + EOF +fi + +sed -i.bak "s,downloads.immortalwrt.org,mirrors.vsean.net/openwrt,g" "/etc/opkg/distfeeds.conf" exit 0 diff --git a/package/emortal/ipv6-helper/files/60-6in4 b/package/emortal/ipv6-helper/files/60-6in4 index 270aad1f90..f297eb4846 100755 --- a/package/emortal/ipv6-helper/files/60-6in4 +++ b/package/emortal/ipv6-helper/files/60-6in4 @@ -1,12 +1,15 @@ #!/bin/sh . /lib/functions.sh + if [ "$ACTION" != "ifup" ]; then exit fi + config_load network -config_get tunnelid $INTERFACE tunnelid -config_get username $INTERFACE username -config_get password $INTERFACE password +config_get tunnelid "$INTERFACE" tunnelid +config_get username "$INTERFACE" username +config_get password "$INTERFACE" password + if [ "$tunnelid" != "" ]; then - wget -O - https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid --no-check-certificate + wget -O - "https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid" fi diff --git a/package/emortal/ipv6-helper/files/60-ipv6-hybrid b/package/emortal/ipv6-helper/files/60-ipv6-hybrid index e6450b259a..40efd986f5 100755 --- a/package/emortal/ipv6-helper/files/60-ipv6-hybrid +++ b/package/emortal/ipv6-helper/files/60-ipv6-hybrid @@ -1,9 +1,15 @@ #!/bin/sh -uci set dhcp.lan.ra='hybrid' -uci set dhcp.lan.ndp='hybrid' -uci set dhcp.lan.dhcpv6='hybrid' -uci set dhcp.lan.ra_management='1' -uci commit dhcp +uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" +uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0 + +uci -q set dhcp.lan.ra="hybrid" +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