11590Srgrimes#!/bin/sh -
21590Srgrimes#
31590Srgrimes# Copyright (c) 1990, 1993
41590Srgrimes#	The Regents of the University of California.  All rights reserved.
51590Srgrimes#
61590Srgrimes# Redistribution and use in source and binary forms, with or without
71590Srgrimes# modification, are permitted provided that the following conditions
81590Srgrimes# are met:
91590Srgrimes# 1. Redistributions of source code must retain the above copyright
101590Srgrimes#    notice, this list of conditions and the following disclaimer.
111590Srgrimes# 2. Redistributions in binary form must reproduce the above copyright
121590Srgrimes#    notice, this list of conditions and the following disclaimer in the
131590Srgrimes#    documentation and/or other materials provided with the distribution.
141590Srgrimes# 4. Neither the name of the University nor the names of its contributors
151590Srgrimes#    may be used to endorse or promote products derived from this software
161590Srgrimes#    without specific prior written permission.
171590Srgrimes#
181590Srgrimes# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
191590Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
201590Srgrimes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
211590Srgrimes# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
221590Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
231590Srgrimes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
241590Srgrimes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
251590Srgrimes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
261590Srgrimes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
271590Srgrimes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
281590Srgrimes# SUCH DAMAGE.
291590Srgrimes#
301590Srgrimes#	@(#)shar.sh	8.1 (Berkeley) 6/6/93
311590Srgrimes#
32179355Sremko# $FreeBSD$
331590Srgrimes
341590Srgrimesif [ $# -eq 0 ]; then
3528871Sitojun	echo 'usage: shar file ...' 1>&2
3628871Sitojun	exit 64			# EX_USAGE
371590Srgrimesfi
381590Srgrimes
3928871Sitojunfor i
4028871Sitojundo
4128879Sitojun	if [ ! \( -d $i -o -r $i \) ]; then
4228879Sitojun		echo "$i inaccessible or not exist" 1>&2
4328871Sitojun		exit 66		# EX_NOINPUT
4428871Sitojun	fi
4528871Sitojundone
4628871Sitojun
471590Srgrimescat << EOF
481590Srgrimes# This is a shell archive.  Save it in a file, remove anything before
491590Srgrimes# this line, and then unpack it by entering "sh file".  Note, it may
501590Srgrimes# create directories; files and directories will be owned by you and
511590Srgrimes# have default permissions.
521590Srgrimes#
531590Srgrimes# This archive contains:
541590Srgrimes#
551590SrgrimesEOF
561590Srgrimes
571590Srgrimesfor i
581590Srgrimesdo
591590Srgrimes	echo "#	$i"
601590Srgrimesdone
611590Srgrimes
621590Srgrimesecho "#"
631590Srgrimes
641590Srgrimesfor i
651590Srgrimesdo
661590Srgrimes	if [ -d $i ]; then
671590Srgrimes		echo "echo c - $i"
681590Srgrimes		echo "mkdir -p $i > /dev/null 2>&1"
691590Srgrimes	else
70179355Sremko		md5sum=`echo -n $i | md5`
711590Srgrimes		echo "echo x - $i"
72179355Sremko		echo "sed 's/^X//' >$i << '$md5sum'"
7328879Sitojun		sed 's/^/X/' $i || exit
74179355Sremko		echo "$md5sum"
751590Srgrimes	fi
761590Srgrimesdone
771590Srgrimesecho exit
781590Srgrimesecho ""
791590Srgrimes
801590Srgrimesexit 0
81