summaryrefslogtreecommitdiff
path: root/etc/daily
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-05-21 01:27:53 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-05-21 01:27:53 +0000
commit5413a7c3fa4205c6bbd49d7d3dae2a2e295ac52f (patch)
tree426e08fe99ea07fa5148d5f1319a5f6c0e01038a /etc/daily
parentf666fe802124b85b8215835d15363b64fa5af727 (diff)
skip the ROOTBACKUP when the destination disk device is not configured;
suggested, tweaked and ok by guenther@
Diffstat (limited to 'etc/daily')
-rw-r--r--etc/daily5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/daily b/etc/daily
index 4cc1436bc1e..0afb4034bf9 100644
--- a/etc/daily
+++ b/etc/daily
@@ -1,5 +1,5 @@
#
-# $OpenBSD: daily,v 1.62 2009/05/18 20:07:35 schwarze Exp $
+# $OpenBSD: daily,v 1.63 2009/05/21 01:27:52 schwarze Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94
#
umask 022
@@ -95,7 +95,8 @@ next_part "Backing up root filesystem:"
rootbak=`awk '$2 == "/altroot" && $1 ~ /^\/dev\// && $3 == "ffs" && \
$4 ~ /xx/ \
{ print substr($1, 6) }' < /etc/fstab`
- [ X$rootdev != X -a X$rootbak != X -a X$rootdev != X$rootbak ] && {
+ [ X$rootdev != X -a X$rootbak != X -a X$rootdev != X$rootbak ] && \
+ sysctl -n hw.disknames | grep -Fqw ${rootbak%[a-p]} && {
next_part "Backing up root=/dev/r$rootdev to /dev/r$rootbak:"
sync
dd if=/dev/r$rootdev of=/dev/r$rootbak bs=16b seek=1 skip=1 \