aboutsummaryrefslogtreecommitdiffstats
path: root/toys/de/de.sh
blob: a75027d7584ce1386a5adc04b198d46a9f45f254 (plain) (blame)
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

# XXX WORK IN PROGRESS

usage() {
    echo "$program [-h] [-tlf] [-r host[,host2]] cmd [cmdargs]"
}

program="`basename $0`"
mode_tmux=0
mode_less=0
mode_file=0
hosts=""
opts="$(getopt -o htlfr: -n "$program" -- "$@")"
err=$?
eval set -- "$opts"
while true; do case $1 in
    -h) usage; exit 1 ;;
    -t) mode_tmux=1; shift ;;
    -l) mode_less=1; shift ;;
    -f) mode_file=1; shift ;;
    -r) shift; hosts="$hosts`shift`" ;;
    --) shift; break ;;
esac done
[[ $err -ne 0 ]] && usage && exit 1

hosts=${hosts-$DE_REMOTE_HOSTS}
echo $hosts

echo "XXX"

#while