|
楼主 |
发表于 2017-7-20 23:01:08
|
显示全部楼层
找到了:/etc/bash.bashrc
- OUT=""
- LOAD=$(w | sed -n 1p | awk '{print $(NF-2), $(NF-1),$(NF-0)}')
- OUT="${OUT}Load: ${LOAD} "
- ## getting temperature from USB termometer
- ## http://www.dx.com/p/81105
- ##
- if which temper >/dev/null; then
- TEMPER=$(temper -c)
- if echo $TEMPER | egrep -qv "Couldn't find the USB device"; then
- TEMPER=$(echo "scale=1;${TEMPER}/1" | bc)
- TEMPER="- Ambient: ${TEMPER}${CEL} "
- else
- TEMPER=""
- fi
- fi
- if [ -d "/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/" ]; then
- TEMP=$(cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input)
- TEMP=$(echo "scale=1;${TEMP}/1000" | bc)
- CEL=$(awk 'BEGIN { print "\302\260C"; }')
- OUT="${OUT}- Board: ${TEMP}${CEL} ${TEMPER}"
- fi
- # if we have a hard drive
- if [ -e '/dev/sda' ]; then
- HDDTEMP=$(/usr/sbin/hddtemp /dev/sda 2>&1)
- if [ $? -eq 0 ]; then
- HDDTEMP=$(echo ${HDDTEMP} | awk '{print $NF}')
- HDDFREE=$(df -h /dev/sda1 | grep sda | awk '{ print " / " $(NF-2)}')
- if [ "${HDDFREE}" != "" ]; then
- HDDFREE="${HDDFREE}"b
- fi
- OUT="${OUT}- Drive: ${HDDTEMP}${HDDFREE} "
- fi
- fi
- MEMFREE=$(free | sed -n 2p | awk '{print $(NF-3)}')
- MEMBUFFERS=$(free | sed -n 2p | awk '{print $(NF-1)}')
- MEMCACHED=$(free | sed -n 2p | awk '{print $(NF)}')
- MEM=$(echo "(${MEMFREE}+${MEMBUFFERS}+${MEMCACHED})/1024" | bc)
- OUT="${OUT}- Memory: ${MEM}Mb"
- echo ""
- echo ${OUT}
- echo ""
复制代码 |
|