# Script written to be compatible with a variety of 'sh' derived shells: # ash, bash, dash ... irhlang="" # encoding inputs and outputs irhtoenc="" irhfromenc="" # see if the shell has any language environment variables set # see locale(7) manpage for this ordering. if test ! -z "$LC_ALL" ; then irhlang="$LC_ALL" elif test ! -z "$LANG"; then irhlang="$LANG" fi # note... all our output strings have the charset hard-coded, but # people may be using a different encoding in their terminal. LANG # strings look like "en_NZ.UTF-8". # Determine the requested output encoding case $irhlang in *.*) irhtoenc=`echo $irhlang | sed 's/.*\.//'` ;; esac # Our French and Spanish strings are in 'iso-8859-1' (Latin 1) encoding; # Russian is the Cyrillic alphabet encoding, 'KOI8-R' case $irhlang in fr*|FR*) irhlang=fr irhfromenc="iso-8859-1" ;; es*|ES*) irhlang=es irhfromenc="iso-8859-1" ;; ru*|RU*) irhlang=ru irhfromenc="koi8r" ;; *) # default irhlang=en irhfromenc="iso-8859-1" ;; esac # "iconv" is the program for converting text between encodings. irhiconv=`which iconv 2>/dev/null` if test $? -ne 0 || test ! -x "$irhiconv" || test -z "$irhfromenc" || test -z "$irhtoenc"; then # we can't convert encodings from some reason irhiconv="cat" else # add the encodings irhiconv="$irhiconv -f $irhfromenc -t $irhtoenc" fi # ASCII art generated at: # http://patorjk.com/software/taag/ # Font = Doom # echo " ___________ _ _ _ " echo "|_ _| ___ \ | | | | | | " echo " | | | |_/ /_____| |_| | __ _ _ ____ _____ ___| |_ " echo " | | | /______| _ |/ _\` | '__\ \ / / _ \/ __| __| " echo " _| |_| |\ \ | | | | (_| | | \ V / __/\__ \ |_ " echo " \___/\_| \_| \_| |_/\__,_|_| \_/ \___||___/\__| " echo echo "(C) 2015, University of Waikato, New Zealand" echo echo # make sure we are sourced, and not run if test "$0" != "`echo $0 | sed s/irharvest-setup\.bash//`" ; then # if $0 contains "irharvest-setup.bash" we've been run... $0 is shellname if sourced. # One exception is zsh has an option to set it temporarily to the script name if test -z "$ZSH_NAME" ; then # we aren't using zsh irharvest_not_sourced=true fi fi if test -n "$irharvest_not_sourced" ; then case "$irhlang" in "es") eval $irhiconv </dev/null 2>&1 # #if [ $? != 0 ] ; then # echo "Unable to find a Java runtime" >2 #else # echo "-----" # echo "To run the IR-Harvest Downloader, type:" # echo " irharvest-download" # echo "" #fi