User Manual

Table Of Contents
Chapter 3. Using the System
echo Hello world
This will generate a reply packet containing text "Hello world". You can generate the wpk file
simply by giving the command tar czf hello.wpk wpkg.pif.
3.5.5.5. Management Operation Example: Software Update
See below for a more complex example of wpkg.pif:
%wpkg-version: 2
%wpkg-prepare:
FOO=‘pwd‘
cd /
tar xzf ${FOO}/files.tar.gz
echo Done.
This example will extract files from the included files.tar.gz file. You can generate the wpk
file with command tar czf update.wpk wpkg.pif files.tar.gz.
3.5.5.6. Management Operation Example: IPQUERY
In this example, we build a simple packet that can be used with a Bluetooth enabled phone to
retrieve the IP address of an Access Server. File wpkg.pif reads:
%wpkg-version: 2
%wpkg-format: vcf
%wpkg-prepare:
ipaddr() {
echo ‘ifconfig nap | grep "inet addr" | awk -F [:] \
\\{print\\$2\\} | awk \\{print\\$1\\}‘
}
serialno() {
echo ‘wrapid | grep Hardware | awk \\{print\\$5\\}‘
}
echo -e "BEGIN:VCARD\r"
echo -e "VERSION:2.1\r"
echo -e "N:‘serialno‘\r"
echo -e "TEL:‘ipaddr‘\r"
echo -e "URL:‘hostname‘\r"
echo -e "END:VCARD\r"
This example will send the reply back as a vCard (contact card). Please note that you have to
include all required vCard formatting by yourself. You can generate the wpk file simply giving
the command tar czf ipquery.wpk wpkg.pif.
To use this example, send the file ipquery.wpk to the inbox of your Bluetooth phone. Check
that you have Bluetooth enabled in the phone. Then, from the phone’s inbox, send the file
ipquery.wpk over Bluetooth to Access Server.
30