-#!/bin/bash
+#!/bin/env bash
# Includes
SRC_DIR=`dirname "$0"`
if [[ -f ~/.config/backup.config ]]; then
CONFIG_FILE="$SRC_DIR/backup.config"
fi
-echo -e "Processing from config: $CONFIG_FILE"
+echo -e "Processing listing set by config: $CONFIG_FILE"
source $CONFIG_FILE
#
-echo -e "\n--------------------------------------------------------------------------------------------------------------"
+echo -e "--------------------------------------------------------------------------------------------------------------"
echo -e " This is an backup archive restore list creator, use this program from the directory you restore to locally."
echo -e " Backup location is DEST_SERVER='$DEST_SERVER'"
echo -e " Restore location is PWD='`pwd`'"
echo -e "--------------------------------------------------------------------------------------------------------------"
echo -e "Syntax: $0 {{--target=/some/path} {--tar | restore.lst}"
echo "After listing, to restore from the backup, use the list with the restore shell script."
-echo "Like: $SRC_DIR/restore.sh ./restore.lst"
+echo -e "Like: $SRC_DIR/restore.sh ./restore.lst"
echo "To restore from a local drive or mount:"
echo "$SRC_DIR/restore.sh --target=/mnt/$user/samsung ./restore.lst"
echo -e "\nOptions/Instructions:\n --tar - Instruction to generate and text tar listing from latest archive. In text format to be viewed.\n"
fi
-if [[ -z $IS_LOCAL ]];
+if [[ "$IS_LOCAL" == "false" || -z "$IS_LOCAL" ]];
then
echo -e "Mounting -> $USER@$DEST_SERVER:$BACKUP_DIRECTORY to $TARGET"
sshfs "$USER@$DEST_SERVER:$BACKUP_DIRECTORY" $TARGET -o allow_other