Plazes Launcher BASH Shell Script

The code described here has been moved into Subversion.

In anticipation of doing some work with mobile devices, I’ve become interested in building a lightweight Plazes launcher — something that doesn’t require a Perl, PHP, Python or any other “scripting language engine” overhead. At the same time, I don’t want something I have to compile — like a C or C++ launcher — partly because I’m lazy, and partly because I’m not smart enough.

The tentative result is a Plazes Launcher BASH Shell Script, a Plazes Launcher that, true to the “little bits of code glued together to do powerful stuff” UNIX philosophy, takes advantage of a whole bunch of [probably installed on your system already] standard UNIX tools to do what needs to be done:

  • The MD5 hash of the Plazes.com password is created using OpenSSL
  • The netstat and arp commands are used to grab the MAC address of the default gateway.
  • The grep, cut, sed and wc commands are used for various string manipulation duties.
  • cURL is used to send a hand-crafted XML-RPC request to the Plazes.com XML-RPC server.

In its current state, the script is Mac OS X-specific because it assumes the output of netstat and arp as it emerges from the OS X versions of those commands (and maybe from all FreeBSD-based systems — I’m not sure about that, though). It should be trivial to modify for other Unices.

Of course, like my earlier Plazes GUI Launcher for Ruby, this BASH version doesn’t do all of the things a Real Plazes.com Launcher should — like error detection, display of useful information, pinging the Plazes.com server every X minutes and so on. But it is a lightweight starting place.

Plazes BASH Launcher screen shot

Comments

Add new comment