CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 11962|回复: 4

SSH登录成功后的登录信息是在哪里实现的

[复制链接]
发表于 2017-7-19 11:13:07 | 显示全部楼层 |阅读模式


如图ssh连接登录成功后上述板子温度信息是哪里实现的?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

发表于 2017-7-20 11:08:35 | 显示全部楼层
到/etc  目录 搜下打印出来的字符吧。 比如:“Board”
回复 支持 反对

使用道具 举报

发表于 2017-7-20 12:23:49 | 显示全部楼层
本帖最后由 nabice 于 2017-7-20 12:25 编辑

没有CT,不知道它怎么弄的
不过一般编辑/etc/motd可以实现,或者可以使用sshd_config的Banner选项。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-7-20 23:01:08 | 显示全部楼层
找到了:/etc/bash.bashrc

  1. OUT=""
  2. LOAD=$(w | sed -n 1p  | awk '{print $(NF-2), $(NF-1),$(NF-0)}')
  3. OUT="${OUT}Load: ${LOAD} "

  4. ## getting temperature from USB termometer
  5. ## http://www.dx.com/p/81105
  6. ##
  7. if which temper >/dev/null; then
  8.    TEMPER=$(temper -c)
  9.    if echo $TEMPER | egrep -qv "Couldn't find the USB device"; then
  10.       TEMPER=$(echo "scale=1;${TEMPER}/1" | bc)
  11.       TEMPER="- Ambient: ${TEMPER}${CEL} "
  12.    else
  13.       TEMPER=""
  14.    fi
  15. fi

  16. if [ -d "/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/" ]; then
  17. TEMP=$(cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input)
  18. TEMP=$(echo "scale=1;${TEMP}/1000" | bc)
  19. CEL=$(awk 'BEGIN { print "\302\260C"; }')
  20. OUT="${OUT}- Board: ${TEMP}${CEL} ${TEMPER}"
  21. fi

  22. # if we have a hard drive
  23. if [ -e '/dev/sda' ]; then
  24.    HDDTEMP=$(/usr/sbin/hddtemp /dev/sda 2>&1)
  25.    if [ $? -eq 0 ]; then
  26.        HDDTEMP=$(echo ${HDDTEMP} | awk '{print $NF}')
  27.        HDDFREE=$(df -h /dev/sda1 | grep sda | awk '{ print " / " $(NF-2)}')
  28.        if [ "${HDDFREE}" != "" ]; then
  29.           HDDFREE="${HDDFREE}"b
  30.        fi
  31.        OUT="${OUT}- Drive: ${HDDTEMP}${HDDFREE} "
  32.    fi
  33. fi


  34. MEMFREE=$(free | sed -n 2p | awk '{print $(NF-3)}')
  35. MEMBUFFERS=$(free | sed -n 2p | awk '{print $(NF-1)}')
  36. MEMCACHED=$(free | sed -n 2p | awk '{print $(NF)}')
  37. MEM=$(echo "(${MEMFREE}+${MEMBUFFERS}+${MEMCACHED})/1024" | bc)
  38. OUT="${OUT}- Memory: ${MEM}Mb"


  39. echo ""
  40. echo ${OUT}
  41. echo ""



复制代码
回复 支持 反对

使用道具 举报

发表于 2017-12-21 15:30:52 | 显示全部楼层
michael kors outlet store
pandora charms sale clearance
uggs outlet
coach outlet online
canada goose outlet
louis vuitton factory outlet
louis vuitton outlet
pandora jewelry
christian louboutin sale
ralph lauren outlet online
mlb jerseys
michael kors
coach outlet online
canada goose
canada goose jackets
adidas ultra boost
kate spade handbags
coach outlet online
cheap ugg boots
adidas yeezy shoes
canada goose coats
cheap jordans for sale
ugg outlet
nike shoes
coach factory outlet
nike sneakers
hermes outlet
moncler outlet online
tory burch outlet online
longchamp bags
ugg canada
uggs clearance
michael kors outlet
ugg boots outlet
coach outlet online
ugg boots outlet
ralph lauren sale
nike air max 2018
coach factory outlet
hermes handbags
adidas outlet store
air max
moncler outlet online
pandora charms sale clearance
kate spade outlet online
caterpillar boots
air jordan retro
canada goose outlet
ugg sale
coach outlet online
coach outlet store
kate spade outlet
adidas sneakers
cheap jordan shoes
nike outlet
moncler uk
canada goose jackets
air max shoes
gucci outlet online
moncler jackets
fitflop sandals
uggs outlet
canada goose
cheap jordan shoes
coach outlet online
hermes bags
cheap air jordans
canada goose jackets
nike shoes
supreme shirts
coach outlet online
pandora charms
moncler outlet online
michael kors handbags
pandora charms outlet
ugg outlet online
canada goose sale
canada goose jackets
burberry handbags
michael kors outlet online
coach outlet online
michael kors outlet clearance
uggs outlet
moncler pas cher
harden vol 1
mulberry uk
michael kors outlet clearance
moncler coats
nike outlet store online
adidas yeezy boost
coach outlet online
coach outlet online
coach factory outlet online
ralph lauren outlet online
canada goose sale
canada goose jackets
moncler outlet online
michael kors outlet store
pandora charms outlet
ralph lauren outlet online
cheap air jordans
ugg boots
moncler jackets
coach purses
burberry handbags
adidas outlet store
polo ralph lauren outlet
polo ralph lauren outlet online
burberry outlet online
north face jackets
yeezy shoes
coach factorty outlet online
kate spade outlet online
michael kors
louis vuitton outlet online
pandora charms sale clearance
cheap jordan shoes
michael kors outlet store
red bottom heels
yeezy boost 350
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-11-25 06:41 , Processed in 0.023773 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部