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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/sh
# A BSD-like install script for SYSV systems.
# Written by Phil Hochstetler, phil@sequent.com
# Modified by Larry Jones larry.jones@sdrc.com
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
FILE=""
DIR=""
while [ X"$1" != X ]; do
case $1 in
-m) chmodcmd="chmod $2"
shift
shift
continue;;
-o) chowncmd="chown $2"
shift
shift
continue;;
-g) chgrpcmd="chgrp $2"
shift
shift
continue;;
-s) stripcmd="strip"
shift
continue;;
-*) echo "$0: unknown option $1" >&2
shift
continue;;
*) if [ X"$FILE" = X ]
then FILE=$1
else DIR=$1
fi
shift
esac
done
if [ X"$FILE" = X -o X"$DIR" = X ]; then
echo "Usage: install [-m ddd] [-o uid] [-g gid] [-s] srcfile dstdir" 1>&2
fi
if [ ! -d "$DIR" ]; then
mkdir $DIR
fi
dst=$DIR/`basename $FILE`
rm -f $dst
cp $FILE $dst
if [ X"$chowncmd" != X ]; then $chowncmd $dst; fi
if [ X"$chgrpcmd" != X ]; then $chgrpcmd $dst; fi
if [ X"$stripcmd" != X ]; then $stripcmd $dst; fi
if [ X"$chmodcmd" != X ]; then $chmodcmd $dst; fi
exit 0
|