diff --git a/ssh_tools/TODO b/ssh_tools/TODO index 04255dc..51e3fce 100644 --- a/ssh_tools/TODO +++ b/ssh_tools/TODO @@ -1 +1 @@ -cluster-deploy: add option to set a destination directory. +multicopy: add option to set a destination directory. diff --git a/ssh_tools/multicopy.sh b/ssh_tools/multicopy.sh index fb640ae..dca19cc 100755 --- a/ssh_tools/multicopy.sh +++ b/ssh_tools/multicopy.sh @@ -1,6 +1,7 @@ #!/bin/sh # -# cluster-deploy.sh, Copyright © 2013 Matteo Cypriani +# multicopy.sh, Copyright © 2013 Matteo Cypriani +# (Formerly named cluster-deploy.sh) # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it @@ -53,7 +54,7 @@ done # Do we still have at least a host list and a file? # Note: if the program was wrongly called but still has 2 arguments, for -# example with "cluster-deploy -l root -P my_file", it will try to use +# example with "multicopy -l root -P my_file", it will try to use # "-P" as hosts' list and "my_file" as the file to be transfered. if [ $# -lt 2 ] ; then print_usage @@ -81,15 +82,15 @@ fi # Check dependencies PSCP=$(command -v parallel-scp || command -v pscp.pssh || command -v pscp) PRSYNC=$(command -v parallel-rsync || command -v prsync) -CLUSTERPING=$(command -v cluster-ping) +MULTIPING=$(command -v multiping) if [ -z "$RSYNC" ] && [ -z "$PSCP" ] ; then echo "Parallel SSH (pssh) is required for this script to work." exit 4 elif [ -z "$PRSYNC" ] ; then echo "Parallel rsync (prsync) is required for this script to work." exit 5 -elif [ -z "$CLUSTERPING" ] ; then - echo "cluster-ping (which should have been provided along with this" +elif [ -z "$MULTIPING" ] ; then + echo "multiping (which should have been provided along with this" echo "script) is required for this script to work." exit 6 fi @@ -99,7 +100,7 @@ HOSTS_LIST_NAME="$1" if [ -z "$XDG_CONFIG_HOME" ] ; then XDG_CONFIG_HOME="$HOME/.config" fi -HOSTS="$XDG_CONFIG_HOME/cluster/${HOSTS_LIST_NAME}.lst" +HOSTS="$XDG_CONFIG_HOME/ssh_tools/${HOSTS_LIST_NAME}.lst" shift echo "Using file '$HOSTS' as hosts' list." if [ ! -f "$HOSTS" ] ; then @@ -116,7 +117,7 @@ fi # Test the connection to the first host and get the destination # directory (home directory of the remote user) -FIRST_HOST=$($CLUSTERPING "$HOSTS_LIST_NAME" 2>/dev/null \ +FIRST_HOST=$($MULTIPING "$HOSTS_LIST_NAME" 2>/dev/null \ | sed -n "s/ is alive$//p" | head -n1) if [ -z "$FIRST_HOST" ] ; then echo "None of the remote hosts is alive." diff --git a/ssh_tools/multiping.sh b/ssh_tools/multiping.sh index c4df121..862c6d1 100755 --- a/ssh_tools/multiping.sh +++ b/ssh_tools/multiping.sh @@ -1,6 +1,7 @@ #!/bin/sh # -# cluster-ping.sh, Copyright © 2013 Matteo Cypriani +# multiping.sh, Copyright © 2013 Matteo Cypriani +# (Formerly named cluster-ping.sh) # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it @@ -20,7 +21,7 @@ fi if [ -z "$XDG_CONFIG_HOME" ] ; then XDG_CONFIG_HOME="$HOME/.config" fi -HOSTS="$XDG_CONFIG_HOME/cluster/$1.lst" +HOSTS="$XDG_CONFIG_HOME/ssh_tools/$1.lst" echo "Using file '$HOSTS' as hosts' list." if [ ! -f "$HOSTS" ] ; then echo "The hosts' list file doesn't exist or is not a regular file." diff --git a/ssh_tools/multissh.sh b/ssh_tools/multissh.sh index 023c71c..880af3f 100755 --- a/ssh_tools/multissh.sh +++ b/ssh_tools/multissh.sh @@ -1,6 +1,7 @@ #!/bin/sh # -# cluster-run.sh, Copyright © 2013 Matteo Cypriani +# multissh.sh, Copyright © 2013 Matteo Cypriani +# (Formerly named cluster-run.sh) # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it @@ -47,7 +48,7 @@ fi if [ -z "$XDG_CONFIG_HOME" ] ; then XDG_CONFIG_HOME="$HOME/.config" fi -HOSTS="$XDG_CONFIG_HOME/cluster/$1.lst" +HOSTS="$XDG_CONFIG_HOME/ssh_tools/$1.lst" shift echo "Using file '$HOSTS' as hosts' list." if [ ! -f "$HOSTS" ] ; then diff --git a/ssh_tools/tabssh.sh b/ssh_tools/tabssh.sh index d6b81bb..71c254e 100755 --- a/ssh_tools/tabssh.sh +++ b/ssh_tools/tabssh.sh @@ -1,6 +1,7 @@ #!/bin/sh # -# cluster-ssh.sh, Copyright © 2013 Matteo Cypriani +# tabssh.sh, Copyright © 2013 Matteo Cypriani +# (Formerly named cluster-ssh.sh) # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it @@ -38,7 +39,7 @@ fi if [ -z "$XDG_CONFIG_HOME" ] ; then XDG_CONFIG_HOME="$HOME/.config" fi -HOSTS_FILE="$XDG_CONFIG_HOME/cluster/$1.lst" +HOSTS_FILE="$XDG_CONFIG_HOME/ssh_tools/$1.lst" shift echo "Using file '$HOSTS_FILE' as hosts' list." if [ ! -f "$HOSTS_FILE" ] ; then