Merge branch 'exec-wrapper' of ssh://git@git.grml.org/grml-scripts into exec-wrapper exec-wrapper
authorMichael Prokop <mika@grml.org>
Mon, 6 Apr 2009 07:06:03 +0000 (09:06 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 6 Apr 2009 07:06:03 +0000 (09:06 +0200)
1  2 
usr_bin/grml-exec-wrapper

@@@ -6,21 -6,16 +6,27 @@@
  # License:       This file is licensed under the GPL v2 or any later version.
  ################################################################################
  
 +usage() {
 +  printf "Usage: $0 <program> [<arguments>]
 +
 +Available options:
 +
 +  -h | --help   display this usage information
 +  -p <program>  check specified argument instead of default args, like:
 +              $(basename $0) -p aumix xterm -T aumix -e aumix
 +"
 +}
 +
  is_installed() {
 -    prog="$1"
 +    prog="$(basename $1)"
      [ -z "$prog" ] && return 1
  
+     case "${prog}" in
+         /*) # deal with absolute-path programs
+             [ -x "${prog}" ] && return 0
+             return 1 ;;
+     esac
      ret=1
      oifs="$IFS"
      IFS=: