#!/bin/bash
MIN_ROOT=/usr/local/minerva
VARLOG=/var/log/minerva

date +"%F %H:%M CMD $0 $*" >>$VARLOG/bearskin/`basename $0`

CODE="$1"

shift
PARAMS=${CODE:5}" $*"

DEVICE=${CODE:0:2}
INSTRUCTION=${CODE:2:3}

SCRIPT=$MIN_ROOT/etc/minx/$DEVICE/$INSTRUCTION 

if [ -f $SCRIPT ]; then
  $SCRIPT $PARAMS
fi

