#!/bin/bash echo Unmounting media umount /media/backup retval=$? if [ "$retval" != "0" ] ; then echo Unmounting media failed: $retval ; fi echo Stopping LUKS-encrypted volume cryptsetup luksClose backup retval=$? if [ "$retval" != "0" ] ; then echo Stopping volume failed: $retval ; fi echo Disassembling linear array mdadm --stop /dev/md0 retval=$? if [ "$retval" != "0" ] ; then echo Disassembling array failed: $retval ; fi echo Syncing disks sync exit $retval