截图发送到PC
2024年1月29日小于 1 分钟约 189 字
代码如下
#!/bin/bash fpath=/OAD/ fname=ci_test.png im_file=/OAD/ci_test.png user="luxing3" passwd="Lx1010#1" ip="192.168.0.12" fpath_pc="D:\ProgramerFiles\TVSscreenshot" if [ -f "$im_file" ]; then
rm $im_file fi
screenshot $fpath $fname
start=
date '+%s'end=expr $start + 5while [ true ] do current=date '+%s'if [ $current -gt $end ]; then break fi if [ -f "$im_file" ]; then # echo "n $n" # echo "-u $user" # echo "-p $passwd" # echo "ip $ip" # echo "fpath_pc $fpath_pc" # echo "fpath_f_name" ftpput -u $user -p $passwd $ip $fpath_pc $im_file rm $im_file echo done break fi done
使用方法:
前提条件:
PC端搭建ftp服务,电视和PC连接至同一局域网 (或使用某个电视可以访问的ftp服务器)
串口输入 iptables -F
将脚本保存至电视,如/OAD/scrsht.sh
然后运行 /OAD/scrsht.sh <ftpuser> <ftppasswd> <ftp_ip> <file_path_upload>
