NetBSD/share/sushi/system/rcconf/script

28 lines
705 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script,v 1.2 2001/01/06 07:31:03 garbled Exp $
. /etc/defaults/rc.conf
CONFFILE="/etc/rc.conf"
echo -n "#Generated by sushi on " >$CONFFILE
date >>$CONFFILE
echo "if [ -r /etc/defaults/rc.conf ]; then" >>$CONFFILE
echo " . /etc/defaults/rc.conf" >>$CONFFILE
echo "fi" >>$CONFFILE
echo "rc_configured=YES" >>$CONFFILE
a=1
IFS="
"
for i in `/usr/share/sushi/system/rcconf/script3`
do
ANS=$(echo `eval echo \\$${a}` | sed -e 's/ $//')
if [ "$ANS" != "`eval echo \\$${i}`" ]; then
if [ "$ANS" = "YES" -o "$ANS" = "NO" ]; then
echo "$i=$ANS" >>$CONFFILE
else
echo "$i=\"$ANS\"" >>$CONFFILE
fi
fi
a=`expr $a + 1`
done
echo "successfully wrote a new $CONFFILE"
cat $CONFFILE