initial checkin
[grml-tips.git] / grml-tips
1 #!/bin/sh
2 # Filename:      grml-tips
3 # Purpose:       query a signature file for a specific keyword and display results
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Sat Mar 25 17:59:52 CET 2006 [mika]
8 ################################################################################
9
10 TIPSFILE='/usr/share/grml-tips/grml_tips'
11
12 if [ -r "$TIPSFILE" ] ; then
13   if [ -n "$1" ] ; then
14     agrep -d "^-- $" -i "$1" $TIPSFILE && echo "" || \
15     ( echo "Sorry, could not find a tip for '$1'"
16       echo 'If you want to submit a tip please send it to tips@grml.org - thank you!' )
17   else
18     echo "Usage: $0 <keyword>" ; exit 1
19   fi
20 else
21   echo "Error: $TIPSFILE not found. Exiting."
22   exit 1
23 fi
24
25 ## END OF FILE #################################################################