cti logy:
#!/bin/bash
# help me read logs
LOGDIR=/var/log
KOCKA=`which cat`
ORANGE=`which grep`
HELP="echo -e ..pass two args, firstone will be name of file in $LOGDIR, secondone, what will i grep.. for more info run 'man grep'\nif u would write results into file, simply use standart redirection method on end of command, such as &>filename or >>filename.."
if [ "$UID" -ne "0" ] || [ -z $1 ]; then
echo "ouch, did i forgot for something?"
exit 1
fi
case $1 in
-h | --help ) $HELP && exit 0;;
esac
if [ -z "$2" ]; then
$KOCKA $LOGDIR/$1; else
$KOCKA $LOGDIR/$1 | $ORANGE $2
fi
..
ps. dale nutno zmenit link /bin/sh, ktery ze zahadnych duvodu odkazuje na /bin/dash, na /bin/bash, samozrejme jako root..
rm /bin/sh && ln -sn /bin/bash /bin/sh && chmod 755 /bin/sh