diff --git a/CustomFiles/Depends/banner b/CustomFiles/Depends/banner index 4599826..f095459 100755 --- a/CustomFiles/Depends/banner +++ b/CustomFiles/Depends/banner @@ -1,10 +1,12 @@ - _______ ________ __ - | |.-----.-----.-----.| | | |.----.| |_ - | - || _ | -__| || | | || _|| _| - |_______|| __|_____|__|__||________||__| |____| - |__| - Powered by AutoBuild - ----------------------------------------------------- - Openwrt - ----------------------------------------------------- + _____ __ __________ .__.__ .___ + / _ \ __ ___/ |_ ____\______ \__ __|__| | __| _/ + / /_\ \| | \ __\/ _ \| | _/ | \ | | / __ | + / | \ | /| | ( <_> ) | \ | / | |__/ /_/ | + \____|__ /____/ |__| \____/|______ /____/|__|____/\____ | + \/ \/ \/ + By + + ———————————————————————————————————————————————— + Openwrt + ———————————————————————————————————————————————— \ No newline at end of file diff --git a/CustomFiles/Depends/profile_lede b/CustomFiles/Depends/profile_lede new file mode 100644 index 0000000..a138973 --- /dev/null +++ b/CustomFiles/Depends/profile_lede @@ -0,0 +1,43 @@ +[ -e /tmp/.failsafe ] && export FAILSAFE=1 +clear +[ -f /etc/banner ] && cat /etc/banner +[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe + +fgrep -sq '/ overlay ro,' /proc/mounts && { + echo '您的 JFFS2 分区似乎已满并且 overlayfs 挂载为只读.' + echo '请尝试从 /overlay/upper/... 删除文件并重启!' +} + +export PATH="/usr/sbin:/usr/bin:/sbin:/bin" +export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) +export HOME=${HOME:-/root} +export PS1='\u@\h:\w\$ ' +export ENV=/etc/shinit + +case "$TERM" in + xterm*|rxvt*) + export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 + ;; +esac + +[ -n "$FAILSAFE" ] || { + for FILE in /etc/profile.d/*.sh + do + [ -e "$FILE" ] && . "$FILE" + done + unset FILE +} + +Target=$([ -f /etc/openwrt_info ] && cat /etc/openwrt_info | awk 'NR==3') +[ -z "${Target}" ] && Target=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_') +IP_Address=$(ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:" | awk 'NR==1') +CoreMark=$([ -f /etc/bench.log ] && egrep -o "[0-9]+" /etc/bench.log | awk 'NR==1') +[ -z "${CoreMark}" ] && CoreMark=0 +Srartup=$(awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d 天 %d 小时 %d 分钟\n",a,b,c)}' /proc/uptime) +Overlay_Available="$(df -h | grep ":/overlay" | awk '{print $4}' | awk 'NR==1')" + +echo -e "\n\n 设备名称: ${Target}" +echo -e " IP 地址: ${IP_Address}" +echo " 运行时间: ${Srartup}" +echo " CoreMark 得分: ${CoreMark}" +echo -e " 可用空间: ${Overlay_Available}\n" \ No newline at end of file diff --git a/Scripts/AutoBuild_Function.sh b/Scripts/AutoBuild_Function.sh index 081ae93..2a441a4 100755 --- a/Scripts/AutoBuild_Function.sh +++ b/Scripts/AutoBuild_Function.sh @@ -77,6 +77,7 @@ Diy_Part2_Base() { Update_Makefile xray-core package/lean/helloworld/xray-core sed -i 's/143/143,8080/' package/lean/helloworld/luci-app-ssr-plus/root/etc/init.d/shadowsocksr Replace_File CustomFiles/Depends/coremark_lede.sh package/lean/coremark coremark.sh + Replace_File CustomFiles/Depends/profile_lede package/base-files/files/etc profile ExtraPackages svn other/../../feeds/packages/admin netdata https://github.com/openwrt/packages/trunk/admin sed -i "s?iptables?#iptables?g" ${Version_File} > /dev/null 2>&1