32 lines
		
	
	
		
			655 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			655 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
### BEGIN INIT INFO
 | 
						|
# Provides:          umountfs
 | 
						|
# Required-Start:
 | 
						|
# Required-Stop:
 | 
						|
# Default-Start:
 | 
						|
# Default-Stop:      0 6
 | 
						|
# Short-Description: Turn off swap and unmount all local file systems.
 | 
						|
# Description:
 | 
						|
### END INIT INFO
 | 
						|
 | 
						|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 | 
						|
 | 
						|
echo "Deactivating swap..."
 | 
						|
swapoff -a
 | 
						|
 | 
						|
# We leave /proc mounted.
 | 
						|
echo "Unmounting local filesystems..."
 | 
						|
grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
 | 
						|
sync
 | 
						|
mount -o remount,ro /
 | 
						|
echo "Remounted / as RO..."
 | 
						|
sync
 | 
						|
umount -f -a -r > /dev/null 2>&1
 | 
						|
mount -t sysfs none /sys
 | 
						|
echo "Running ubidetach commands..."
 | 
						|
ubidetach -d 2
 | 
						|
ubidetach -d 1
 | 
						|
umount /sys -f
 | 
						|
 | 
						|
: exit 0
 |