#!/system/bin/sh
# fastboot: wrapper to run fastboot from terminal
# osm0sis @ xda-developers

dir="$(cd "$(dirname "$0")"; pwd)";

case $1 in
  ""|help|--help|-h) $dir/fastboot.bin --help;;
  version|--version) $dir/fastboot.bin --version | sed 's/fastboot.bin/fastboot/';;
  *)
    if [ "$USER" == "root" -o "$(whoami 2>/dev/null)" == "root" ]; then
      $dir/fastboot.bin "$@";
    else
      echo "Must be root";
      exit 1;
    fi;
  ;;
esac;

