#! /bin/bash
#  * LF Backup *
#  wrapper for lf-backup.py
#  toolset similar to known unix file system tools for easy
#  interaction with the openstack swift object store 
# 
# 10.24.2016 - bmcgough
#    modified to use Lmod correctly (as root)
#    source old modulefiles as EB Python does not include swictclient
#    avoid bash 'if [ -d $INVALID_ENV_VAR ]' as that returns true


scriptname=${0##*/}
cwd=$(pwd)

# get credentials

if [[ -f ~/.lf-backuprc ]]; then
  source ~/.lf-backuprc
fi

if [[ -d /app/Lmod/lmod/lmod/init ]]; then
  source /app/Lmod/lmod/lmod/init/bash
  module use /app/Modules/modulefiles
  printf "   loading module python3/3.5.0\n"
  module load python3/3.5.0 > /dev/null 2>&1
fi 

lfbackup.py $@
