imagereport.txt

来自「这是《嵌入式linux-硬件、软件与接口》一书对应的所有linux方面实例的源代」· 文本 代码 · 共 46 行

TXT
46
字号
#!/bin/bash
# imageReport v1.0 12/31/01
# www.embeddedlinuxinterfacing.com
#
# The original location of this code is
# http://www.embeddedlinuxinterfacing.com/chapters/12/
#
# Copyright (C) 2001 by Craig Hollabaugh
#
# This program is free software; you can redistribute it and/or modify
# it however you want.
#
# imageReport 
# imageReport is a bash script that executes on a target board
# with an external video camera and its driver loaded. Loading
# the driver, connects the camera to the /dev/video file. 
#
# This script queries the tbdev1's apache HTTP server on port 80
# using nc to obtain the image command. It then executes this command.
# The command is formatted with all the command line parameters
# for the specific target based on based on the target's IP address.
# nc is configured with the -w flag which sets a connection timeout. 
# If tbdev1's apache server doesn't answer, this script will continue 
# to operate.
#
# The image command will also contain a sleep statement to pause
# the main loop.
#
# Call this from inittab using the respawn option as in
# T3:23:respawn:/usr/bin/imageReport
# If imageReport should die, init will start it again
#
# loop forever
while [ 1 ]
do

# get the command
 imageCommand=`echo "GET /cgi-bin/imageGetCommand" \
               | nc -w 10 192.168.1.11 80`

# execute the command and produce no output
 eval $imageCommand > /dev/null 2>&1 

done

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?