NetBSD/share/sushi/system/weeklyconf/script

28 lines
692 B
Bash
Executable File

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