tune.restore.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
# Copyright 1990, 1991 Sun Microsystems, Inc. All Rights Reserved.
#
#
#ident "%Z%%M% %I% %E% SMI"
# This script reverses file attributes changed by tune.task back
# to what they used to be according to the archive file -
# name of this script
# -p option is for previewing the changes.
fail()
{
echo
echo "$myname failed:"
echo $*
exit 1
}
# usage: not_lower level1 level2
# return: 0 if level1 is not lower than level2 (higher or equal)
# 1 if lower
{
level1=$1
level2=$2
null)
then
return 0
fi;;
low)
then
return 0
fi;;
med)
then
return 0
fi;;
high)
return 0;;
esac
return 1
}
# usage: between_levels level1 level2
# prints all the levels in between (inclusively) level1 and level2
# from the highest down.
# level1 is assumed to be not lower than level2.
{
level1=$1
level2=$2
then
l=$level1
echo "$l \c"
do
case $l in
esac
echo "$l \c"
done
echo
fi
}
echo
echo "Beginning $myname..."
echo "(This may take a while.)"
if [ "$ASETDIR" = "" ]
then
fail "ASETDIR variable undefined."
fi
then
fail "Permission denied."
fi
if [ $# -gt 0 ]
then
if [ "$1" = "-p" ]
then
echo
echo "Performing preview only ..."
CHOWN="echo chown "
CHMOD="echo chmod "
CHGRP="echo chgrp "
else
echo $usage
exit 1
fi
fi
export LEVELS
arch_files=""
do
done
if [ "$arch_files" != "" ]
then
arch_files=`/bin/ls -t $arch_files 2> /dev/null`
fi
do
do
# Skip comments and white lines
if [ "$path" = "#" ]
then
continue;
elif [ "$path" = "" ]
then
continue;
fi
# Warn and skip lines without all the required fields
if [ "$type" = "" ]
then
echo
echo "Warning: bad entry:"
continue;
fi
# Warn and skip lines with too many fields
if [ "$junk" != "" ]
then
echo
echo "Warning: bad entry:"
continue;
fi
#
# If the object does not exist on this system then skip it.
#
then
echo
echo "Warning! $path does not exist - skipped."
continue;
fi
if [ "$type" != "symlink" -a \
then
if [ "$type" = "directory" ]
then
fi
fi
then
fi
then
fi
done < $arch # while loop
done # for loop
echo
echo "$myname completed."