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 ################################################################################
11 [ -z "$prog" ] && return 1
17 [ -z "$dir" ] && continue
18 [ -x "$dir/$prog" ] && ret=0 && break
26 # use Xdisplay only if present and running under X:
28 if is_installed Xdialog 1>/dev/null 2>&1 && test -n "$DISPLAY" ; then
29 Xdialog --title "grml-exec-wrapper" --msgbox "$1" 0 0 0
36 display_info "Usage: $0 <program> [<arguments>]"
43 # make sure to support 'grml-exec-wrapper sudo wireshark' as well:
48 if is_installed "$PROG" 1>/dev/null 2>&1 ; then
52 display_info "Sorry: ${PROG} not available.
54 Looks like the grml flavour you are using does not ship ${PROG}. :(
56 You can search for ${PROG} executing:
58 apt-get update && apt-cache search ${PROG}
64 ## END OF FILE #################################################################