SVN: rc-scripts/trunk/rc.d/rc.shutdown

blues blues at pld-linux.org
Sun Oct 28 14:06:44 CET 2007


Author: blues
Date: Sun Oct 28 14:06:44 2007
New Revision: 8883

Modified:
   rc-scripts/trunk/rc.d/rc.shutdown
Log:
- run ntfsfix if there are some ntfs filesystems mounted
  and if proper app is installed


Modified: rc-scripts/trunk/rc.d/rc.shutdown
==============================================================================
--- rc-scripts/trunk/rc.d/rc.shutdown	(original)
+++ rc-scripts/trunk/rc.d/rc.shutdown	Sun Oct 28 14:06:44 2007
@@ -60,6 +60,7 @@
 	retry=3
 	force=
 	remaining=$(awk '!/(^#| proc | loopfs | devfs | devpts | shm | iso9660 | ramfs | tmpfs | sysfs | securityfs | squashfs |^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts)
+	mounted_ntfs=$(awk '/(^ ntfs )/ {print $1}' /proc/mounts)
 	while [ -n "$remaining" -a "$retry" -gt 0 ]; do
 	 	show "Unmounting file systems"; busy
 		ERRORS=$(umount -a $force -t noproc,devfs 2>&1); rc=$?
@@ -91,6 +92,12 @@
 
 	run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
 
+	if [ -f "/usr/bin/ntfsfix" -a "$mounted_ntfs" ]; then
+		for filesystem in $mounted_ntfs; do
+			/usr/bin/ntfsfix $filesystem
+		done
+	fi
+
 	if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
 		lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1; exit}')
 		if [ "$lvmversion" = "2" ] ; then


More information about the pld-cvs-commit mailing list