aboutsummaryrefslogtreecommitdiff
path: root/scripts/batch-process
blob: bdd67a933b87c848fe0216a2cdf29c3926bddad2 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
usage()
{
cat << EOF
usage: $0 options

OPTIONS:
  -h  Show this message
  -i  Input file
  -V  verbose mode

Input file should contain the following format:

VideoType:VideoLocation:StartNumber:CropList

Ex First10MinSet:/path/to/video/First10MinGroup8:68:First10MinGroup8CropList.txt

Copyright 2012 Calvin Morrison
EOF
}

function log () {
    if [[ $verbose -eq 1 ]]; then
        echo "$@"
    fi
}

# Declaration of Variables
verbose=
input_file=

while getopts "Vhi:" OPTION
do
  case $OPTION in
    h)
      usage
      exit 1
      ;;
    V)
      verbose=1
      ;;
    i)
      input_file=$OPTARG
      ;;
    ?)
      usage
      exit
      ;;
  esac
done


if [[ -z $input_file ]] 
then
  usage
  exit 1
fi

if [ -f "$input_file" ]; then
  log "$input_file exists."
else
  echo "error: $input_file was not found"
  exit 1  
fi