Fix kernel build for UP+KTR
[dragonfly.git] / contrib / ipfilter / bsdinstall
blobce921b60fa4707775f6e6059d44aea2effd20552
1 #! /bin/sh
3 # @(#)install.sh 4.5 (Berkeley) 10/12/83
5 cmd=/bin/mv
6 strip=""
7 chmod="chmod 755"
8 chown="chown -f root"
9 chgrp="chgrp -f bin"
10 while true ; do
11 case $1 in
12 -s ) strip="strip"
13 shift
15 -c ) cmd="cp"
16 shift
18 -m ) chmod="chmod $2"
19 shift
20 shift
22 -o ) chown="chown -f $2"
23 shift
24 shift
26 -g ) chgrp="chgrp -f $2"
27 shift
28 shift
30 -d ) cmd="mkdir"
31 shift
33 * ) break
35 esac
36 done
38 if [ ! ${2-""} ]
39 then echo "install: no destination specified"
40 exit 1
42 if [ ${3-""} ]
43 then echo "install: too many files specified -> $*"
44 exit 1
46 if [ $1 = $2 -o $2 = . ]
47 then echo "install: can't move $1 onto itself"
48 exit 1
50 case $cmd in
51 /bin/mkdir )
52 file=$2/$1
54 * )
55 if [ '!' -f $1 ]
56 then echo "install: can't open $1"
57 exit 1
59 if [ -d $2 ]
60 then file=$2/$1
61 else file=$2
63 /bin/rm -f $file
65 esac
67 case $cmd in
68 /bin/mkdir )
69 if [ ! -d "$file" ]
70 then $cmd $file
73 * )
74 $cmd $1 $file
75 if [ $strip ]
76 then $strip $file
79 esac
81 $chown $file
82 $chgrp $file
83 $chmod $file