|
本帖最后由 awhs123 于 2019-6-5 14:10 編輯
雖然樓主是個(gè)小白,但是從來(lái)都不甘心做一個(gè)平凡的人,就算是一個(gè)花里胡哨的菜雞,那也是很開(kāi)心滴,今天給大家分享一個(gè)強(qiáng)迫癥比較在乎的N1盒子ssh登陸信息美化教程。
N1盒子ssh登陸信息美化教程
1.首先去除一下上次登陸信息
在/etc/ssh/sshd_config
將PrintLastLog后面的yes改為no 補(bǔ)充,歡迎訪問(wèn)在/etc/update-motd.d/10-armbian-header
2.美化頂部s905圖片
修改/etc/armbian-release
將BOARD_NAME="JK 's N 1"這里改才你想要的名稱,不能中文
3.漢化信息
修改/etc/update-motd.d/30-armbian-sysinfo
底部的一些信息進(jìn)行漢化
- ...
- # display info
- display "系統(tǒng)負(fù)載" "${load%% *}" "${critical_load}" "0" "" "${load#* }"
- printf "開(kāi)機(jī)時(shí)間: \x1B[92m%s\x1B[0m\t\t" "$time"
- display "本地用戶" "${users##* }" "3" "2" ""
- echo "" # fixed newline
- display "內(nèi)存已用" "$memory_usage" "70" "0" " %" " of ${memory_total}MB"
- display "交換內(nèi)存" "$swap_usage" "75" "0" " %" " of $swap_total""Mb"
- printf "IP 地址: "
- printf "\x1B[92m%s\x1B[0m" "$ip_address"
- echo "" # fixed newline
- a=0;b=0;c=0
- display "CPU 溫度" "$board_temp" "45" "0" "°C" "" ; a=$?
- display "環(huán)境溫度" "$amb_temp" "40" "0" "°C" "" ; b=$?
- (( ($a+$b) >0 )) && echo "" # new line only if some value is displayed
- display "閃存已用" "$root_usage" "90" "1" "%" " of $root_total"
- display "存儲(chǔ)已用" "$storage_usage" "90" "1" "%" " of $storage_total"
- display "電池" "$battery_percent" "20" "1" "%" "$status_battery_text"
復(fù)制代碼
4.修改一下開(kāi)機(jī)時(shí)間,以支持中文- # get uptime, logged in users and load in one take
- UptimeString=$(uptime | tr -d ',')
- time=$(awk -F" " '{print $3" 分鐘"}' <<<"${UptimeString}")
- load="$(awk -F"average: " '{print $2}'<<<"${UptimeString}")"
- users="$(awk -F" user" '{print $1}'<<<"${UptimeString}")"
- case ${time} in
- *:*) # 1-2 hours
- tt1=$(awk -F" " '{print $3}' <<<"${UptimeString}")
- tt=$(echo $tt1|tr ':' ' ')
- t1=$(awk -F" " '{print $1" 小時(shí)"}' <<<"${tt}")
- t2=$(awk -F" " '{print $2" 分鐘"}' <<<"${tt}")
- time="$t1 $t2"
- ;;
- esac
復(fù)制代碼 分享網(wǎng)友:ljk4160
以上就是跟大家分享的N1盒子ssh登陸信息美化教程了,希望小伙伴們能夠擁有一顆愛(ài)美的心。
|
上一篇: N1盒子小鋼炮Transmission緩存最佳設(shè)置方法下一篇: N1的WIFI 5G的速度可以達(dá)到多了?
|