Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/sushi/system/dailyconf Add a menu entry to sushi to ha...



details:   https://anonhg.NetBSD.org/src/rev/1c866854e3f0
branches:  trunk
changeset: 506855:1c866854e3f0
user:      garbled <garbled%NetBSD.org@localhost>
date:      Tue Mar 06 21:15:40 2001 +0000

description:
Add a menu entry to sushi to handle editing of the /etc/daily.conf file.

diffstat:

 share/sushi/system/dailyconf/Makefile |  10 ++++++++++
 share/sushi/system/dailyconf/form     |  14 ++++++++++++++
 share/sushi/system/dailyconf/help     |   6 ++++++
 share/sushi/system/dailyconf/script   |  27 +++++++++++++++++++++++++++
 share/sushi/system/dailyconf/script1  |  10 ++++++++++
 share/sushi/system/dailyconf/script3  |   6 ++++++
 6 files changed, 73 insertions(+), 0 deletions(-)

diffs (97 lines):

diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/Makefile     Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,10 @@
+#      $NetBSD: Makefile,v 1.1 2001/03/06 21:15:40 garbled Exp $
+
+FILES= form help
+FILESDIR=${BINDIR}/sushi/system/dailyconf
+SCRIPTS= script script1 script3
+SCRIPTSDIR=${BINDIR}/sushi/system/dailyconf
+MKOBJ= no
+
+.include "../../../Makefile.inc"
+.include <bsd.prog.mk>
diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/form
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/form Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: form,v 1.1 2001/03/06 21:15:41 garbled Exp $
+script:script1,find_core       Search the machine for core files?
+script:script1,expire_news     Run /etc/expire.news script?
+script:script1,purge_accounting        Age accounting files in /var/account?
+script:script1,run_msgs                Run 'msgs -c'?
+script:script1,run_calendar    Run 'calendar -a'?
+script:script1,check_uucp      Clean up uucp and run 'uustat -a'?
+script:script1,check_disks     Run df and dump to give disk status?
+script:script1,check_mailq     Run mailq?
+script:script1,check_network   Check network status?
+script:script1,run_fsck                Run 'fsck -n'?
+script:script1,run_rdist       Run rdist with /etc/Distfile?
+script:script1,run_security    Run /etc/security?
+script:script1,run_skeyaudit   Run skeyaudit(8)?
diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/help
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/help Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,6 @@
+The daily.conf file specifies which of the standard /etc/daily services
+are performed.  The /etc/daily script is run, by default, every night
+via cron on a NetBSD system.  Please see the manpage for daily.conf(5) for
+more details.
+
+$NetBSD: help,v 1.1 2001/03/06 21:15:41 garbled Exp $
diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/script
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/script       Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,27 @@
+#!/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
diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/script1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/script1      Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,10 @@
+#!/bin/sh
+# $NetBSD: script1,v 1.1 2001/03/06 21:15:41 garbled Exp $
+. /etc/daily.conf
+CONF=`eval echo \\$${1}`
+echo $CONF
+if [ "$CONF" = "YES" ]; then
+       echo "NO"
+else
+       echo "YES"
+fi
diff -r 4f6314e6cec0 -r 1c866854e3f0 share/sushi/system/dailyconf/script3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/sushi/system/dailyconf/script3      Tue Mar 06 21:15:40 2001 +0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $NetBSD: script3,v 1.1 2001/03/06 21:15:41 garbled Exp $
+sh -x /etc/defaults/daily.conf 2>&1 | sed -e 's/^+ //' | \
+       sed -e 's/\([EN][SO]\) /\1\
+/' | sed -e 's/=.*//'
+# the newline above is there for a reason



Home | Main Index | Thread Index | Old Index