summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-03-04 20:24:57 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-03-04 20:24:57 +0000
commitb5d8499ca8d182867e57fc72cdf481ebae50cfd8 (patch)
treeec654643e442f63eae044191678a108d2fb8133d /etc/rc
parentd5f60dba2dd94347b005a4540ece7caf012e0ca2 (diff)
downloadpfsense-b5d8499ca8d182867e57fc72cdf481ebae50cfd8.zip
pfsense-b5d8499ca8d182867e57fc72cdf481ebae50cfd8.tar.gz
Trigger a FSCK if required before switching on softupdates
Diffstat (limited to 'etc/rc')
-rwxr-xr-xetc/rc9
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index 217367a..e9f8b93 100755
--- a/etc/rc
+++ b/etc/rc
@@ -41,7 +41,14 @@ fi
# Enable Softupdates if enablesoftupdates is found in config.xml
SOFTUPDATES=`/usr/bin/grep "enablesoftupdates" /cf/conf/config.xml | wc -l`
if [ $SOFTUPDATES -gt 0 ]; then
- /sbin/tunefs -n enable / 2>/dev/null
+ FILESYSTEM=`cat /etc/fstab | grep "/" | grep ufs | awk '{ print $1 }'`
+ /sbin/tunefs -n enable $FILESYSTEM 2>/dev/null
+ if [ $? != 0 ]; then
+ echo "Cleaning filesystem..."
+ fsck -y $FILESYSTEM
+ echo "Attempting soft updates enable again..."
+ /sbin/tunefs -n enable $FILESYSTEM
+ fi
fi
# Enable console output if its muted.
OpenPOWER on IntegriCloud