2014年5月16日 星期五

acpid study

all configuration files will be placed underneath /etc/acpi/
all events will be placed underneath /etc/acpi/events
all actions will be placed underneath /etc/acpi/actions
run acpi_listen command to monitor ACPI events
specify log file for all acpi events --> acpid -l /var/log/acpid
when an acpi event occurred, acpid will check configuration files underneath /etc/acpi/events and go into any events that match the event definition.

sample
# anything.conf
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e

# handler.sh
logger "acpi event: $1 / $2 / $3 /$4"
exit 0

2014年5月5日 星期一

wsf tag

package
job id
script language="VBScript" src="1.vbs"
example
named--> name|helpstring|type|required
WScript.Arguments.Named.Exists("name")
WScript.Arguments.ShowUsage

1 package can contain multiple job id.

CScript //job:"donein vbs" 4.wsf

include in vbscript

1: use filesystemobject to read all contents of external script
2: ExecuteGlobal objfso.ReadAll