SKT
11/23/2019 - 7:38 PM

Auto login and check client modem public IP on NUCs (Vinz)

>Log in to Alpha server from Ubuntu default terminal as below:
	station@statopm:~$ ssh -l sktuser 192.168.1.155

>Log in to vinz server from Alpha server
	ssh -l sktuser vinz.letsdochinese.com 

>edit(open) the command execution file as below:
  sktuser@vinz:~$ vi ./command-for-one-nuc.sh
  
>The command 【curl https://ipinfo.io/ip】is to check the modemn public IP,
#commands begin:

CMD="curl https://ipinfo.io/ip"   

#end of commands

[Note] Also you can change the command [curl https://ipinfo.io/ip] to "curl -vv http://coreapp.letsdochinese.com" to check the printer DNS issue
[Note] change the command to  "sudo smartctl -s on -i -A -f brief -f hex,id -l devstat /dev/sda | awk '/0x09/ {print $2,$8/24} /0x0c/ {print $2,$8} /0xf1/ {printf "Total written %.3f G\n", $8 * 512/ 1024^3} /0x07  0x008/ {printf "Used %d %\n", $4} /7  0x008/ {printf "Used %d %\n", $4} '
" to check NUC life time.

>edit(open) the NUCs id list file , all nuc id will be fill in as below
  sktuser@vinz:~$ vi ./nucs 

> fill in the nuc id for example: no "r" or "R"
81001
81002
81003
81005
81006

>start run the commands on NUCs:
 sktuser@vinz:~$ ./login-and-run-on-nucs.sh 
 
>check the exectution result store in file nuc_check_result which can be check out as below:
 sktuser@vinz:~$ vi ./nuc_check_result 
 
> the result will be seperate by "start for nucid" and "end for nucid" as below example:
start for 81001.
108.25.60.22
end for 81001.
start for 81002.