summarylogtreecommitdiffstats
path: root/xperia-flashtool.sh
blob: fb569f5893c67202a5c270ff339ac52437f31b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

if [ $# -eq 0 ]; then
  APP_CMD='FlashTool'
else
  case "$1" in
    -c|--console)
      APP_CMD='FlashToolConsole'
      shift
      ;;
    -g|--graphical)
      APP_CMD='FlashTool'
      shift
      ;;
    *)
      cat << EOF
Usage: $0 [OPTIONS]

Options are:
    -h, --help                       : show this help
    -c, --console                    : console mode usage
    -g, --graphical                  : graphical mode usage
EOF
      exit 1
      ;;
  esac
fi

if [ -d "/usr/lib/xperia-flashtool/firmwares" ]
then
  mkdir -p "$HOME/.flashTool/firmwares"
  mv /usr/lib/xperia-flashtool/firmwares/* "$HOME/.flashTool/firmwares"
fi

/usr/lib/xperia-flashtool/${APP_CMD} $@