save_cfg revision 178369
1178369Sphk#!/bin/sh 2178369Sphk# 3178369Sphk# Copyright (c) 2006 Mathieu Arnold 4178369Sphk# All rights reserved. 5178369Sphk# 6178369Sphk# Redistribution and use in source and binary forms, with or without 7178369Sphk# modification, are permitted provided that the following conditions 8178369Sphk# are met: 9178369Sphk# 1. Redistributions of source code must retain the above copyright 10178369Sphk# notice, this list of conditions and the following disclaimer. 11178369Sphk# 2. Redistributions in binary form must reproduce the above copyright 12178369Sphk# notice, this list of conditions and the following disclaimer in the 13178369Sphk# documentation and/or other materials provided with the distribution. 14178369Sphk# 15178369Sphk# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16178369Sphk# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17178369Sphk# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18178369Sphk# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19178369Sphk# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20178369Sphk# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21178369Sphk# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22178369Sphk# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23178369Sphk# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24178369Sphk# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25178369Sphk# SUCH DAMAGE. 26178369Sphk# 27178369Sphk# $FreeBSD: head/tools/tools/nanobsd/Files/root/save_cfg 178369 2008-04-21 06:22:27Z phk $ 28178369Sphk# 29178369Sphk 30178369Sphkset -e 31178369Sphk 32178369Sphktrap "umount /cfg" 1 2 15 EXIT 33178369Sphkmount /cfg 34178369Sphk( 35178369Sphkcd /cfg 36178369Sphkfor i in "$@" `find * -type f` 37178369Sphkdo 38178369Sphk cmp -s /etc/$i /cfg/$i || cp -pfv /etc/$i /cfg/$i 39178369Sphkdone 40178369Sphk) 41178369Sphkumount /cfg 42178369Sphktrap 1 2 15 EXIT 43