File: example.ia_ssh

package info (click to toggle)
shellia 5.7.6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 728 kB
  • sloc: sh: 7,087; makefile: 34
file content (32 lines) | stat: -rwxr-xr-x 706 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# vim: set filetype=sh :
#        file: example.ia_ssh
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2021)
#     license: GNU General Public License, version 3
# description: test using ia_ssh with command given as one argument
#              and as more arguments
#    see also: test.ia_ssh

set -e
set -u

. ./ia

eval "$ia_init"

sshopts=""
while [ $# -gt 0 ]; do
  if [ "$1" = "--sshopts" ]; then
    sshopts="$2"
    shift 2
  else
    cat <<END >&2
Usage: example_ssh [--sshopts <sshopts>]
END
    exit 1
  fi
done
ia_add "ia_ssh $<sshopts> localhost \"cd /tmp; pwd\""
ia_add "ia_ssh $<sshopts> localhost cd /tmp\; pwd"
ia_add "ia_ssh $<sshopts> localhost \"exit 7\""
ia