|
|
1.1 root 1: #! /bin/sh
2: #
3: # @(#)install.sh 4.8 (Berkeley) 3/6/86
4: #
5: cmd=""
6: stripbefore=""
7: stripafter=""
8: chmod="/bin/chmod -f 755"
9: chown="/etc/chown -f root"
10: chgrp="/bin/chgrp -f staff"
11: while true ; do
12: case $1 in
13: -s ) if [ $cmd ]
14: then stripafter="/bin/strip"
15: else stripbefore="/bin/strip"
16: fi
17: shift
18: ;;
19: -c ) if [ $cmd ]
20: then echo "install: multiple specifications of -c"
21: exit 1
22: fi
23: cmd="/bin/cp"
24: stripafter=$stripbefore
25: stripbefore=""
26: shift
27: ;;
28: -m ) chmod="/bin/chmod -f $2"
29: shift
30: shift
31: ;;
32: -o ) chown="/etc/chown -f $2"
33: shift
34: shift
35: ;;
36: -g ) chgrp="/bin/chgrp -f $2"
37: shift
38: shift
39: ;;
40: * ) break
41: ;;
42: esac
43: done
44: if [ $cmd ]
45: then true
46: else cmd="/bin/mv"
47: fi
48:
49: if [ ! ${2-""} ]
50: then echo "install: no destination specified"
51: exit 1
52: fi
53: if [ ${3-""} ]
54: then echo "install: too many files specified -> $*"
55: exit 1
56: fi
57: if [ $1 = $2 -o $2 = . ]
58: then echo "install: can't move $1 onto itself"
59: exit 1
60: fi
61: if [ '!' -f $1 ]
62: then echo "install: can't open $1"
63: exit 1
64: fi
65: if [ -d $2 ]
66: then file=$2/`basename $1`
67: else file=$2
68: fi
69: /bin/rm -f $file
70: if [ $stripbefore ]
71: then $stripbefore $1
72: fi
73: $cmd $1 $file
74: if [ $stripafter ]
75: then $stripafter $file
76: fi
77: $chown $file
78: $chgrp $file
79: $chmod $file
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.