config root man

Current Path : /usr/src/release/picobsd/mfs_tree/stand/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/src/release/picobsd/mfs_tree/stand/update

#!/bin/sh
# $FreeBSD: release/9.1.0/release/picobsd/mfs_tree/stand/update 92059 2002-03-11 05:15:44Z luigi $
# script to edit and save some config file(s).
# If called with no arguments, it edits 3 files in /etc
thefiles=$*
[ -z "$thefiles" ] && \
    thefiles="/etc/rc.conf /etc/rc.firewall /etc/master.passwd"
dev=`sysctl -n machdep.guessed_bootdev`
[ -c "${dev}" ] || dev="/dev/fd0"
mount ${dev} /mnt
if [ "$?" != "0" ] ; then
	echo ""
	echo "Cannot mount ${dev} read-write!"
	exit 1
fi

echo "Updating ${thefiles} on ${dev}: "

for f in ${thefiles} ; do
    case $f in
    /etc )
	echo  "Update all files in $f :"
	srcs=`ls $f`
	for i in $srcs ; do
	    if [ -f /mnt${f}/${i}.gz ]; then
		echo -n "$i ..."
		gzip < $f/$i > /mnt${f}/${i}.gz
	    fi
	done
	echo " Done."
	;;

    passwd|master.passwd)
	mkdir -p /mnt/etc
	ee /etc/master.passwd
	pwd_mkdb /etc/master.passwd
	gzip < /etc/master.passwd > /mnt/etc/master.passwd.gz
	;;

    /*)	# only absolute pathnames are ok
	mkdir -p /mnt/etc /mnt/root
	[ -f $f ] && ee $f && gzip < $f > /mnt${f}.gz
        ;;

    *)
	echo "File $f not recognised, you must use an absolute pathname."
	;;
    esac
done
umount /mnt

Man Man