2 # Filename: grml-exec-wrapper
3 # Purpose: simple but smart program execution wrapper
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 or any later version.
7 ################################################################################
10 printf "Usage: $0 <program> [<arguments>]
14 -h | --help display this usage information
15 -p <program> check specified argument instead of default args, like:
16 $(basename $0) -p aumix xterm -T aumix -e aumix
22 [ -z "$prog" ] && return 1
28 [ -z "$dir" ] && continue
29 [ -x "$dir/$prog" ] && ret=0 && break
37 # use Xdisplay only if present and running under X:
39 if is_installed xterm && test -n "$DISPLAY" ; then
40 xterm -T 'Sorry :(' -e "dialog --msgbox \"$1\" 0 0"
46 if [ -z "$1" -o "$1" = '-h' -o "$1" = '--help' ] ; then
51 if [ "$1" = '-p' ] ; then
61 # make sure to support 'grml-exec-wrapper sudo wireshark' as well:
67 if is_installed "$PROG" ; then
71 display_info "Sorry: ${PROG} not available.
73 Looks like the grml flavour you are using does not ship ${PROG}. :(
75 You can search for ${PROG} executing:
77 apt-get update && apt-cache search $(basename ${PROG})
82 ## END OF FILE #################################################################