#!/bin/sh
REV=`uname -r`
INSMOD=/sbin/insmod
SYSMON=/usr/local/bin/sysmon

echo Good, you have linux $REV

if [ $UID != "0" ]; then
  echo Not good, you are not root.  Load monitor.o by hand and run
  echo sysmon, or run this script as root.
  exit
fi

# maybe we already loaded it, but what the hell. fake it.
BAKA=`/sbin/lsmod | grep monitor`
mkdir -p /lib/modules/$REV/misc
if [ "$BAKA" != "" ]; then
  echo monitor.o already loaded
else
  $INSMOD /lib/modules/$REV/misc/monitor.o 1>/dev/null 2>/dev/null 3>/dev/null
fi
$SYSMON $@
