NetBSD/share/sushi/system/dailyconf/script

28 lines
687 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:15:41 garbled Exp $
. /etc/defaults/daily.conf
pwd
CONFFILE="/etc/daily.conf"
echo -n "#Generated by sushi on " >$CONFFILE
date >>$CONFFILE
echo "if [ -r /etc/defaults/daily.conf ]; then" >>$CONFFILE
echo " . /etc/defaults/daily.conf" >>$CONFFILE
echo "fi" >>$CONFFILE
a=1
IFS="
"
for i in `/usr/share/sushi/system/dailyconf/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