2 # $FreeBSD: src/release/picobsd/mfs_tree/stand/update,v 1.2.2.3 2002/03/13 18:15:52 luigi Exp $
3 # $DragonFly: src/release/picobsd/mfs_tree/stand/Attic/update,v 1.2 2003/06/17 04:27:20 dillon Exp $
4 # script to edit and save some config file(s).
5 # If called with no arguments, it edits 3 files in /etc
7 [ -z "$thefiles" ] && \
8 thefiles="/etc/rc.conf /etc/rc.firewall /etc/master.passwd"
9 dev=`sysctl -n machdep.guessed_bootdev`
10 [ -c "${dev}" ] || dev="/dev/fd0"
12 if [ "$?" != "0" ] ; then
14 echo "Cannot mount ${dev} read-write!"
18 echo "Updating ${thefiles} on ${dev}: "
20 for f in ${thefiles} ; do
23 echo "Update all files in $f :"
26 if [ -f /mnt${f}/${i}.gz ]; then
28 gzip < $f/$i > /mnt${f}/${i}.gz
37 pwd_mkdb /etc/master.passwd
38 gzip < /etc/master.passwd > /mnt/etc/master.passwd.gz
41 /*) # only absolute pathnames are ok
42 mkdir -p /mnt/etc /mnt/root
43 [ -f $f ] && ee $f && gzip < $f > /mnt${f}.gz
47 echo "File $f not recognised, you must use an absolute pathname."