summaryrefslogtreecommitdiff
path: root/etc/rc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-03 18:11:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-03 18:11:52 +0000
commitd506e3349de8d747ad1756bc69d1ca302d8fd0f1 (patch)
treee5e800fe4354696f828ac2149909d120582ad6ef /etc/rc
parent0fea0dd47ea6070fd1755262432fd2fc46562ccd (diff)
have shutdown code run /etc/rc with arg of "shutdown"; rc.shutdown becomes completely admin-editable
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc18
1 files changed, 17 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index 460958aecb8..90042626013 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.107 1999/08/31 03:47:16 deraadt Exp $
+# $OpenBSD: rc,v 1.108 1999/09/03 18:11:48 deraadt Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -16,6 +16,22 @@ HOME=/; export HOME
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
+if [ $1x = shutdownx ]; then
+ dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1
+ chmod 600 /var/db/host.random >/dev/null 2>&1
+ if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then
+ echo /etc/rc.shutdown in progress...
+ . /etc/rc.shutdown
+ echo /etc/rc.shutdown complete.
+ if [ "X${powerdown}" = X"YES" ]; then
+ exit 2
+ fi
+ else
+ echo single user: not running /etc/rc.shutdown
+ fi
+ exit 0
+fi
+
# Configure ccd devices.
if [ -f /etc/ccd.conf ]; then
ccdconfig -C