#!/bin/sh
# 	http://www.berklix.com/~jhs/bin/.sh/rc.shutmedia
# Installed to /site/etc/rc.shutmedia by ~/public_html/bin/.sh/Makefile
# Called by:	/etc/rc.shutdown
#	http://www.berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/etc/rc.shutdown.REL=ALL.diff
# Calls
# 	http://www.berklix.com/~jhs/bin/.sh/rc.shutusb
# 	http://www.berklix.com/~jhs/bin/.sh/rc.shutint
# See Also (reversing effect of):
#	http://www.berklix.com/~jhs/bin/.sh/gbde2.sh
#	/site/usr/local/etc/rc.d/shutmedia
# Untested On:	Sticks that may have multiple gbde crypted partitions.
# Bugs:		No support for geli.
# Copyright "Julian H. Stacey" <jhs_ERASE_@berklix.com>, public under BSD licence.

# -x not -f below to alos allow a symbolic link to work
if [ -x "/etc/rc.shutint" ]; then
	/etc/rc.shutint	# shut down internal encrypted file systems
fi

#	- Scripts in 2 parts for:
#		- external usb mounted sticks & disks
#		- internal mounted FS
#	  reason: when I want to leave laptop behind, still running & mounted,
#	  but take usb stick on key ring for backup in case of fire or burglary.

if [ -x "/etc/rc.shutusb" ]; then
	/etc/rc.shutusb	# # shut down external USB connected file systems
fi
