xref: /titanic_51/usr/src/cmd/bnu/Teardown (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1#!/usr/bin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23#ident	"%Z%%M%	%I%	%E% SMI"	/* from SVR4 bnu:Teardown 1.5 */
24
25export IFS PATH
26IFS="
27"
28PATH="/usr/bin"
29
30#
31#	This shell tries to convert uucp from the QFT format back to the
32#	the regular HoneyDanBer format and removes all sub directories
33#	that created while running the QFT version of uucp.
34#
35
36echo "Converting uucp from QFT Format back to HoneyDanBer format\n"
37
38SPOOL=/var/spool/uucp
39#	chdir to remote spool directory
40cd $SPOOL
41if [ `pwd` != "$SPOOL" ]
42then
43	echo "CAN'T cd to $SPOOL"
44	echo "$0 failed."
45	exit 0
46fi
47for d in */?
48do
49#	chdir to grade directories of the remote
50	cd $d
51	if [ "$?" = 0 ]
52	then
53#	   move everything to parent (machine) directory
54	   find . -print | cpio -pdvm ..
55	   if [ "$?" = 0 ]
56	   then
57#		now remove everything in this directory
58		rm -rf *
59	   fi
60	   cd $SPOOL
61#	   if grade directory is now empty, remove it.
62	   rmdir $d
63	fi
64done >/dev/null 2>&1
65