head	1.4;
access;
symbols
	perseant-exfatfs-base-20250801:1.4
	perseant-exfatfs-base-20240630:1.4
	cjep_sun2x:1.4.0.44
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	cjep_staticlib_x:1.4.0.42
	cjep_staticlib_x-base:1.4
	phil-wifi-20200421:1.4
	phil-wifi-20200411:1.4
	phil-wifi-20200406:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	pgoyette-compat-0728:1.4
	pgoyette-compat-0625:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	pgoyette-compat:1.4.0.40
	pgoyette-compat-base:1.4
	perseant-stdc-iso10646:1.4.0.38
	perseant-stdc-iso10646-base:1.4
	prg-localcount2-base3:1.4
	prg-localcount2-base2:1.4
	prg-localcount2-base1:1.4
	prg-localcount2:1.4.0.36
	prg-localcount2-base:1.4
	pgoyette-localcount-20170426:1.4
	bouyer-socketcan-base1:1.4
	pgoyette-localcount-20170320:1.4
	bouyer-socketcan:1.4.0.34
	bouyer-socketcan-base:1.4
	pgoyette-localcount-20170107:1.4
	pgoyette-localcount-20161104:1.4
	localcount-20160914:1.4
	pgoyette-localcount-20160806:1.4
	pgoyette-localcount-20160726:1.4
	pgoyette-localcount:1.4.0.32
	pgoyette-localcount-base:1.4
	netbsd-5-2-3-RELEASE:1.4
	netbsd-5-1-5-RELEASE:1.4
	yamt-pagecache-base9:1.4
	yamt-pagecache-tag8:1.4
	tls-earlyentropy:1.4.0.28
	tls-earlyentropy-base:1.4
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4
	riastradh-drm2-base3:1.4
	netbsd-5-2-2-RELEASE:1.4
	netbsd-5-1-4-RELEASE:1.4
	netbsd-5-2-1-RELEASE:1.4
	netbsd-5-1-3-RELEASE:1.4
	agc-symver:1.4.0.30
	agc-symver-base:1.4
	tls-maxphys-base:1.4
	yamt-pagecache-base8:1.4
	netbsd-5-2:1.4.0.26
	yamt-pagecache-base7:1.4
	netbsd-5-2-RELEASE:1.4
	netbsd-5-2-RC1:1.4
	yamt-pagecache-base6:1.4
	yamt-pagecache-base5:1.4
	yamt-pagecache-base4:1.4
	netbsd-5-1-2-RELEASE:1.4
	netbsd-5-1-1-RELEASE:1.4
	yamt-pagecache-base3:1.4
	yamt-pagecache-base2:1.4
	yamt-pagecache:1.4.0.24
	yamt-pagecache-base:1.4
	bouyer-quota2-nbase:1.4
	bouyer-quota2:1.4.0.22
	bouyer-quota2-base:1.4
	matt-nb5-pq3:1.4.0.20
	matt-nb5-pq3-base:1.4
	netbsd-5-1:1.4.0.18
	netbsd-5-1-RELEASE:1.4
	netbsd-5-1-RC4:1.4
	netbsd-5-1-RC3:1.4
	netbsd-5-1-RC2:1.4
	netbsd-5-1-RC1:1.4
	netbsd-5-0-2-RELEASE:1.4
	netbsd-5-0-1-RELEASE:1.4
	jym-xensuspend-nbase:1.4
	netbsd-5-0:1.4.0.16
	netbsd-5-0-RELEASE:1.4
	netbsd-5-0-RC4:1.4
	netbsd-5-0-RC3:1.4
	netbsd-5-0-RC2:1.4
	jym-xensuspend:1.4.0.14
	jym-xensuspend-base:1.4
	netbsd-5-0-RC1:1.4
	netbsd-5:1.4.0.12
	netbsd-5-base:1.4
	yamt-pf42-base4:1.4
	yamt-pf42-base3:1.4
	hpcarm-cleanup-nbase:1.4
	yamt-pf42-base2:1.4
	yamt-pf42:1.4.0.10
	yamt-pf42-base:1.4
	mjf-devfs2:1.4.0.8
	mjf-devfs2-base:1.4
	keiichi-mipv6-nbase:1.4
	keiichi-mipv6:1.4.0.6
	keiichi-mipv6-base:1.4
	cube-autoconf:1.4.0.4
	cube-autoconf-base:1.4
	hpcarm-cleanup:1.4.0.2
	hpcarm-cleanup-base:1.4
	netbsd-3-1-1-RELEASE:1.3
	netbsd-3-0-3-RELEASE:1.3
	netbsd-3-1:1.3.0.6
	netbsd-3-1-RELEASE:1.3
	netbsd-3-0-2-RELEASE:1.3
	netbsd-3-1-RC4:1.3
	netbsd-3-1-RC3:1.3
	netbsd-3-1-RC2:1.3
	netbsd-3-1-RC1:1.3
	netbsd-3-0-1-RELEASE:1.3
	netbsd-3-0:1.3.0.4
	netbsd-3-0-RELEASE:1.3
	netbsd-3-0-RC6:1.3
	netbsd-3-0-RC5:1.3
	netbsd-3-0-RC4:1.3
	netbsd-3-0-RC3:1.3
	netbsd-3-0-RC2:1.3
	netbsd-3-0-RC1:1.3
	netbsd-2-0-3-RELEASE:1.2
	netbsd-2-1:1.2.0.6
	netbsd-2-1-RELEASE:1.2
	netbsd-2-1-RC6:1.2
	netbsd-2-1-RC5:1.2
	netbsd-2-1-RC4:1.2
	netbsd-2-1-RC3:1.2
	netbsd-2-1-RC2:1.2
	netbsd-2-1-RC1:1.2
	netbsd-2-0-2-RELEASE:1.2
	netbsd-3:1.3.0.2
	netbsd-3-base:1.3
	netbsd-2-0-1-RELEASE:1.2
	netbsd-2:1.2.0.4
	netbsd-2-base:1.2
	netbsd-2-0-RELEASE:1.2
	netbsd-2-0-RC5:1.2
	netbsd-2-0-RC4:1.2
	netbsd-2-0-RC3:1.2
	netbsd-2-0-RC2:1.2
	netbsd-2-0-RC1:1.2
	netbsd-2-0:1.2.0.2
	netbsd-2-0-base:1.2
	netbsd-1-6-PATCH002-RELEASE:1.1
	netbsd-1-6-PATCH002:1.1
	netbsd-1-6-PATCH002-RC4:1.1
	netbsd-1-6-PATCH002-RC3:1.1
	netbsd-1-6-PATCH002-RC2:1.1
	netbsd-1-6-PATCH002-RC1:1.1
	netbsd-1-6-PATCH001:1.1
	netbsd-1-6-PATCH001-RELEASE:1.1
	netbsd-1-6-PATCH001-RC3:1.1
	netbsd-1-6-PATCH001-RC2:1.1
	netbsd-1-6-PATCH001-RC1:1.1
	fvdl_fs64_base:1.1
	netbsd-1-6-RELEASE:1.1
	netbsd-1-6-RC3:1.1
	netbsd-1-6-RC2:1.1
	netbsd-1-6-RC1:1.1
	netbsd-1-6:1.1.0.2
	netbsd-1-6-base:1.1;
locks; strict;
comment	@# @;


1.4
date	2006.02.08.00.47.33;	author christos;	state dead;
branches;
next	1.3;

1.3
date	2005.01.18.18.12.55;	author peter;	state Exp;
branches;
next	1.2;

1.2
date	2004.03.09.21.36.37;	author garbled;	state Exp;
branches;
next	1.1;

1.1
date	2001.03.06.21.24.13;	author garbled;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Bye bye sushi config files (moved to othersrc via repository copy)
@
text
@#!/bin/sh
# $NetBSD: script,v 1.3 2005/01/18 18:12:55 peter Exp $

BACKUPDIR="/var/sushi"
CONFFILE="/etc/security.conf"
BACKUP="${BACKUPDIR}/security.conf"

echo "Saving changes..."

if [ ! -d $BACKUPDIR ]; then
	mkdir $BACKUPDIR
	chown root:wheel $BACKUPDIR
	chmod 700 $BACKUPDIR
fi

# create a backup
cp -p $CONFFILE $BACKUP
if [ $? -ne 0 ]; then
	echo "Can't create a backup"
	exit 1
fi

# temporary files
cp -p $BACKUP $BACKUP.new
cp -p $BACKUP $BACKUP.old

. /etc/defaults/security.conf
. $CONFFILE

a=1
for i in `/usr/share/sushi/system/securityconf/script3`
do
	new=$(echo `eval echo \\$${a}` | sed -e 's/ $//' | sed -e 's/^0*//')
	old=`eval echo \\$${i}`
	if [ "$new" != "$old" ]; then
		line=`grep -n $i $BACKUP | cut -f1 -d:`
		# if no such line, add a new entry, otherwise edit the entry.
		if [ -z "$line" ]; then
			if [ "$new" = "YES" -o "$new" = "NO" ]; then
				echo "$i=$new" >> $BACKUP.new
			else
				echo "$i=\"$new\"" >> $BACKUP.new
			fi
		else
			sed "${line}s/$old/$new/" < $BACKUP.old > $BACKUP.new
			if [ $? -ne 0 ]; then
				echo "sed failed"
				rm -f $BACKUP.new $BACKUP.old
				exit 1
			fi
		fi
		cp -p $BACKUP.new $BACKUP.old
	fi
	a=`expr $a + 1`
done

cp -p $BACKUP.new $CONFFILE

if [ $? -eq 0 ]; then
	echo "Successfully wrote a new $CONFFILE"
	echo ""
	cat $CONFFILE
else
	echo "Failed to write a new $CONFFILE"
fi

rm -f $BACKUP.new $BACKUP.old

exit 0
@


1.3
log
@Minor cleanup and tweaks, be consistent with the other system admin scripts.
@
text
@d2 1
a2 1
# $NetBSD: script,v 1.2 2004/03/09 21:36:37 garbled Exp $
@


1.2
log
@Apply patches in PR bin/24645 by Peter Postma:
	Here are some enhancements to sushi's System Maintenance menu.
	To summarize the changes:

	* Make a backup of the file before modifying it.
	* Fixes to get all menus/forms working.
	* Missing/invalid settings (like in rc.conf and inetd.conf)
	  have been added/removed.
	* Most files don't get overwritten now but are edited instead.
	  So specials settings in e.g. /etc/rc.conf don't get lost now.
	* Some help menu fixes. ($NetBSD$ tag has been removed because I
	  don't see how it would be useful for either user or developer).
@
text
@d2 1
a2 1
# $NetBSD: script,v 1.1 2001/03/06 21:24:13 garbled Exp $
d16 1
a16 1
# backup
d18 4
d37 2
a38 2
		# if no line, add new entry, otherwise edit the entry.
		if [ -z $line ]; then
d64 1
a64 1
	echo "Failed"
@


1.1
log
@Add a menu entry to sushi to deal with editing the /etc/security.conf file.
@
text
@d2 21
a22 1
# $NetBSD: script,v 1.1 2001/01/05 02:06:59 garbled Exp $
d24 2
a25 7
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
a26 2
IFS="
"
d29 11
a39 4
	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
d41 6
a46 1
			echo "$i=\"$ANS\"" >>$CONFFILE
d48 1
d52 14
a65 2
echo "successfully wrote a new $CONFFILE"
cat $CONFFILE
@

