Commit 4d535d21 authored by clewsy's avatar clewsy

Added option to specify ssh protocol - ivp4 by default.

parent 3351552f
......@@ -52,6 +52,12 @@ Options: -q Quiet mode - suppress most output.
VERBOSITY="" ## Define the default verbosity (i.e. none). Can be changed with option -v.
DEST="/dev/null" ## Default destination for output. Change to /dev/stdout with option -v.
######### Define protocol to be used by ssh.
## Options are: "-4" : IPV4
## "-6" : IPV6
## "" : System default.
PROTOCOL="-4"
##########Interpret options
while getopts 'qvh' OPTION; do ## Call getopts to identify selected options and set corresponding flags.
case "$OPTION" in
......@@ -122,7 +128,7 @@ while read -r REM_SYS <&2; do ## Loop to repeat commands for each file name entr
COLUMN_SPACER="${COLUMN_SPACER} " ## Add a space every iteration.
done
if ! ssh -t "${REM_SYS}" "${COMMAND} ${VERBOSITY}"; then ## Attempt to connect via ssh and run the backup script "bu.sh"
if ! ssh "${PROTOCOL}" -t "${REM_SYS}" "${COMMAND} ${VERBOSITY}"; then ## Attempt to connect via ssh and run the backup script "bu.sh"
echo -E "${REM_SYS}${COLUMN_SPACER} ${RED}Failure.${RESET}" >> "${TEMP_BALL_SUMMARY}" ## Record if the above fails for the current host.
echo -e "${RED}Failure.${RESET}" ## Also show failure on stdio.
echo -e "$(TIMESTAMP) - Failed to run ${COMMAND} on ${REM_SYS}." >> "${BALL_LOG_FILE}" ## Also record to log file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment