#!/bin/bash
#
DOCROOT=`grep -Po '^chdir = \K.*' /etc/php-fpm.d/www.conf 2>/dev/null`
if [ -z ${DOCROOT} ];then
	DOCROOT="/usr/local/emhttp"
fi

# Set status that the array is shutting down
touch /tmp/unassigned.devices/shut_down

logger "Unmounting All Devices..." -t"unassigned.devices"
${DOCROOT}/plugins/unassigned.devices/scripts/rc.unassigned umount all &>/dev/null

# Clear that array is shutting down
rm -rf /tmp/unassigned.devices/shut_down
