⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 accessallow.txt

📁 这是《嵌入式linux-硬件、软件与接口》一书对应的所有linux方面实例的源代码
💻 TXT
字号:
#!/bin/bash
# accessAllow 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.
#
# accessAllow 
# accessAllow is a CGI script. A target board sends an HTTP 
# request with a pass RFID as a the parameter. 
# Apache calls this script setting the $QUERY_STRING variable 
# to the pass RFID. This script forms a SELECT statement 
# that returns whether the pass is valid or not (1 or 0). This 
# script also logs the access.
#
# Here's the header/content blank separation line required by Apache
echo

# get the location as the last octet of the target board's IP address
location=`echo $REMOTE_ADDR | cut -f 4 -d '.'`

# get the pass ID
passID=$QUERY_STRING

# query the database for the pass valid field for this passID
echo "SELECT guests.passValid from guests where passID = \"$passID\";" \
| mysql trailblazer --user=trailblazer --pass=tb --silent 

# log the access
echo "INSERT INTO accesses (location,passID) VALUES ($location,\"$passID\");" \
| mysql trailblazer --user=trailblazer --pass=tb

⌨️ 快捷键说明

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