测试
Posted 草帽小子
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了测试相关的知识,希望对你有一定的参考价值。
#!/bin/bash
echo -e "\\033[0;32m
_ _ ____ _____ _______
| | | |/ __ \\ / ____|__ __|
| |__| | | | | (___ | |
| __ | | | |\\___ \\ | |
| | | | |__| |____) | | |
|_| |_|\\____/|_____/ |_| by haha\\033[0m"
# os
upSeconds="$(cut -d. -f1 /proc/uptime)"
secs=$(($upSeconds%60))
mins=$(($upSeconds/60%60))
hours=$(($upSeconds/3600%24))
days=$(($upSeconds/86400))
UPTIME_INFO=$(printf "%d days, %02dh %02dm %02ds" "$days" "$hours" "$mins" "$secs")
if [ -f /etc/redhat-release ] ; then
PRETTY_NAME=$(< /etc/redhat-release)
elif [ -f /etc/debian_version ]; then
DIST_VER=$(</etc/debian_version)
PRETTY_NAME="$(grep PRETTY_NAME /etc/os-release | sed -e \'s/PRETTY_NAME=//g\' -e \'s/"//g\') ($DIST_VER)"
else
PRETTY_NAME=$(cat /etc/*-release | grep "PRETTY_NAME" | sed -e \'s/PRETTY_NAME=//g\' -e \'s/"//g\')
fi
if [[ -d "/system/app/" && -d "/system/priv-app" ]]; then
model="$(getprop ro.product.brand) $(getprop ro.product.model)"
elif [[ -f /sys/devices/virtual/dmi/id/product_name ||
-f /sys/devices/virtual/dmi/id/product_version ]]; then
model="$(< /sys/devices/virtual/dmi/id/product_name)"
model+=" $(< /sys/devices/virtual/dmi/id/product_version)"
elif [[ -f /sys/firmware/devicetree/base/model ]]; then
model="$(< /sys/firmware/devicetree/base/model)"
elif [[ -f /tmp/sysinfo/model ]]; then
model="$(< /tmp/sysinfo/model)"
fi
以上是关于测试的主要内容,如果未能解决你的问题,请参考以下文章