-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_all_videos
executable file
·50 lines (41 loc) · 1.16 KB
/
index_all_videos
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
#!/bin/bash
SCRIPTDIR=$( (cd -P $(dirname $0) && pwd) )
corename=videos
BASEDIR=$SCRIPTDIR/common
# load the shared bash functions log, vlog and Verbose
. $BASEDIR/outputfuncs.bash
verbose=
force=
test=
index=staging:production
while getopts :vfti: opt
do
case $opt in
v) verbose=-v;;
t) test=-t;;
f) force=-f;;
i) index=$OPTARG
esac
done
shift $((OPTIND-1))
if [ "$force" == "-f" ] ; then
Verbose "Forcing index rebuild with -f flag"
fi
Verbose " "
Verbose "Starting update of Virgo4 index for Video items "`/bin/date "+%Y-%m-%d_%H:%M"`
$SCRIPTDIR/kanopy/updateifnewer $verbose $test $force -i $index
resultkanopy=$?
$SCRIPTDIR/swank/updateifnewer $verbose $test $force -i $index
resultswank=$?
Verbose "Finished update of Virgo4 index for Video items "`/bin/date "+%Y-%m-%d_%H:%M"`
if [[ "$resultkanopy" == "0" && "$resultswank" == "0" ]] ; then
exit 0
else
if [[ "$resultkanopy" != "0" ]] ; then
Echo "FAILURE on update of Virgo4 index for kanopy video items"
fi
if [[ "$resultswank" != "0" ]] ; then
Echo "FAILURE on update of Virgo4 index for swank video items"
fi
exit 1
fi