拿到小蚁摄像头的 shell
把小蚁摄像头里的内存卡取出来,在内存卡根目录建立一个文件夹 test
在 test 目录下创建文件 equip_test.sh 粘贴以下内容。
- #!/bin/sh
- # Telnet
- if [ ! -f "/etc/init.d/S88telnet" ]; then
- echo "#!/bin/sh" > /etc/init.d/S88telnet
- echo "telnetd &" >> /etc/init.d/S88telnet
- chmod 755 /etc/init.d/S88telnet
- fi
- dr=`dirname $0`
- # fix bootcycle
- mv $dr/equip_test.sh $dr/equip_test.sh.moved
- reboot
根据网上的说法,equip_test.sh 会在开机的时候自动运行。
这个脚本的内容很简单,第一步创建 /etc/init.d/S88telnet 这个文件,内容如下:
- #!/bin/sh
- telnetd &
这个文件相当于创建了一个 busybox-init 的 服务 [1],和 ubuntu、CentOS 的服务类似,不过功能更简单一些,直接就是一个 shell 脚本。这个 shell 脚本开启了 telnetd 后台程序。
第二步是把自身重命名并且重启,避免每次摄像头开机重复运行。
现在,可以把内存卡查到摄像头中开机,不出意外的话现在再次在终端里输入 telnet xxx.xxx.xxx.xxx 就可以看到 (none) login: 了,现在输入用户名 root 按回车,再输入密码 1234qwer 就可以进入小蚁摄像头的 shell 界面了。