Sha256: f868660c648ccfbb1bedacc87f72417719b57455474e92b59eed8f1ba09379c1

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

#! /bin/sh
############################################################################

ssh_config_file=${SSH_CONFIG_FILE:-config/ssh}
remote_dir=${REMOTE_DIR:-$(pwd)/linecook}
remote_script=${REMOTE_SCRIPT:-run}

usage="usage: %s [-F SSH_CONFIG_FILE] [-D REMOTE_DIR] [-S REMOTE_SCRIPT] [-h] PACKAGE_DIRS...\n"
option="       %s   %s\n"
while getopts "F:D:S:h" opt
do
  case $opt in
  F  )  ssh_config_file=$OPTARG ;;
  D  )  remote_dir=$OPTARG ;;
  S  )  remote_script=$OPTARG ;;
  h  )  printf "$usage" $0
        printf "$option" "-F" "the ssh config file"
        printf "$option" "-D" "the remote package dir"
        printf "$option" "-S" "the remote script"
        printf "$option" "-h" "prints this help"
        exit 0 ;;
  \? )  printf "$usage" $0
        exit 2 ;;
  esac
done
shift $(($OPTIND - 1))

################################### run ####################################

for package_dir in "$@"
do
host=$(basename -- "$package_dir")

ssh -q -t -t -F "$ssh_config_file" "$host" -- "$remote_dir/$remote_script" 2>/dev/null </dev/null

status=$?
if [ $status -ne 0 ]
then
  echo "[$status] $remote_dir/$remote_script" >&2
  exit 1
fi

done

################################## (run) ###################################

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
linecook-1.2.1 bin/linecook_run
linecook-1.2.0 bin/linecook_run
linecook-1.1.0 bin/linecook_run
linecook-1.0.0 bin/linecook_run