NetBSD/share/sushi/system/securityconf/script

28 lines
721 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:24:13 garbled Exp $
. /etc/defaults/security.conf
pwd
CONFFILE="/etc/security.conf"
echo -n "#Generated by sushi on " >$CONFFILE
date >>$CONFFILE
echo "if [ -r /etc/defaults/security.conf ]; then" >>$CONFFILE
echo " . /etc/defaults/security.conf" >>$CONFFILE
echo "fi" >>$CONFFILE
a=1
IFS="
"
for i in `/usr/share/sushi/system/securityconf/script3`
do
ANS=$(echo `eval echo \\$${a}` | sed -e 's/ $//' | sed -e 's/^0*//')
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