|
|
1.1 root 1: # @(#)uuto 1.5
2: a=""
3: f=""
4: d=""
5: sub=""
6: mysys=`uuname -l`
7: mesg="Usage: $0 [-m -p] files remote!user"
8: if test $# -lt 1
9: then
10: echo $mesg
11: exit
12: fi
13: trap "trap '' 0; exit" 0 1 2 13 15
14: copy=0
15: # get options
16: while true
17: do
18: case $1 in
19: -m) a="$a $1" sub="$sub -m" ;;
20: -p) copy=1 sub="$sub -p" ;;
21: -*) echo $mesg; exit;;
22: *) break ;;
23: esac
24: shift
25: done
26: # get file names
27: while test $# -gt 1
28: do
29: if test -d "$1" -a {"$1" = "." -o "$1" = ".."}
30: then shift; continue
31: elif test -r "$1" -a -f "$1"
32: then f="$f $1"
33: elif test -r "$1" -a -d "$1"
34: then d="$d $1"
35: elif test "$UUP" = ""
36: then echo "$1: file/directory not found"; exit
37: fi
38: shift
39: done
40: # the recipient arg: remote!user
41: remote=`expr $1 : '\(.*\)!'`
42: user=`expr $1 : '.*!\(.*\)' \| $1`
43: if test 1 -eq "$copy"
44: then a="$a -C"
45: fi
46: a="$a -d -n$user"
47: error=1
48: if test -n "$d" -a -n "$user"
49: then
50: for i in $d
51: do
52: ( cd $i; UUP="$UUP/$i"
53: for j in `ls -a`
54: do
55: if test "$j" = "." -o "$j" = ".."; then continue;
56: else
57: FILES="$FILES $j"
58: fi
59: done
60: if test "$FILES"; then
61: uuto $sub $FILES $1;fi)
62: error=0
63: done
64: fi
65: if test -n "$f" -a -n "$user"
66: then
67: uucp $a $f $remote!~/receive/$user/$mysys$UUP/
68: error=0
69: fi
70: if test $error = 1
71: then
72: echo $mesg
73: exit 2
74: fi
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.