From 089dd6b846106f97320bdfa17d29d559c2266038 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 9 Dec 2010 17:10:06 -0700 Subject: [PATCH] Get external helper programs working --- helper | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 helper diff --git a/helper b/helper new file mode 100755 index 0000000..747c3fe --- /dev/null +++ b/helper @@ -0,0 +1,28 @@ +#! /bin/sh + +sender=$1 +forum=$2 + +read cmd args +case $cmd in + .hi) + echo "Hi, ASL" + ;; + .date) + date + ;; + .msgme) + echo ":PRIVMSG $sender :hey baby" + ;; + .finger) + host="$(echo $args | cut -d@ -f 2)" + [ "$host" = "$args" ] && host=lanl.gov + echo $args | cut -d@ -f 1 | nc $host finger + ;; + .calc) + echo $args | bc -l + ;; + *) + echo "I'm sorry, $sender, I don't understand that command." + ;; +esac