source: main/trunk/greenstone3/ext-cli/get-selfcontained-rclone.sh@ 37376

Last change on this file since 37376 was 37376, checked in by davidb, 14 months ago

New top-level ext-cli, this time for the rclone command line tool that can sync content from cloud platforms such as Google

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3OS_ALLCAPS=`uname | tr 'a-z' 'A-Z'`
4
5selfcon_ext=selfcontained-rclone
6installed_dir=${selfcon_ext}/rclone
7
8echo ""
9if [ ! -d $selfcon_ext ] ; then
10 echo "Checking out from svn: Greenstone3's $selfcon_ext extension"
11 svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext
12
13 if [ $? != 0 ] ; then
14 echo "Error encountered checking out: " 1>&2
15 echo " svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext" 1>&2
16 exit 1
17 fi
18else
19 echo "Detected directory '$selfcon_ext'"
20 echo "=> Taken to mean that the svn check-out command has already been run"
21fi
22
23echo ""
24if [ ! -d $installed_dir ] ; then
25 echo "Runing the $selfcon_ext/PREPARE-${OS_ALLCAPS}.sh"
26
27 cd $selfcon_ext && ./PREPARE-${OS_ALLCAPS}.sh
28
29 if [ $? != 0 ] ; then
30 echo "Error encountered running: " 1>&2
31 echo " cd $selfcon_ext && ./PREPARE-${OS_ALLCAPS}.sh" 1>&2
32 exit 1
33 fi
34
35else
36 echo "Detected directory '$installed_dir'"
37 echo "=> Taken to mean that the $selfcon_ext/PREPARE-${OS_ALLCAPS}.sh command has already been run"
38fi
39
40
41if [ "x$RCLONE_HOME" != "x$PWD/$installed_dir" ] ; then
42 echo ""
43 echo "To use this installed version of RClone, in the top-level Greenstone3 directory run:"
44 echo " source ./gs3-setup-cli.sh"
45 echo ""
46else
47 echo ""
48 echo "Detected RCLONE_HOME set to \$PWD/$installed_dir"
49 echo "=> Taken to mean that the $selfcon_ext SETUP.sh file has been sourced"
50fi
51
52echo ""
Note: See TracBrowser for help on using the repository browser.