1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/usb_lib/templates/umount.d/70-usb-library

24 lines
725 B
Bash

#!/bin/bash
# Remove symlink in /library/content to autmounted usb drive
#
# based on a similar script in the xs-rsync package
# by Martin Langhoff <martin@laptop.org>
#
# and the adaptation for xs-activity-server by Douglas Bagnall
# <douglas@paradise.net.nz>
#
# by Tim Moody tim@timmoody.com
CONTENT_LINK_USB=`basename $UM_MOUNTPOINT | awk '{print toupper($0)}'`
CONTENT_LINK="{{ doc_root }}/local_content/$CONTENT_LINK_USB"
logger -p user.notice -t "70-usb-library" -- "Attempting to remove link $CONTENT_LINK."
if [ -L $CONTENT_LINK ]; then
{% if is_debuntu %}
/bin/rm -f $CONTENT_LINK
{% else %}
/usr/bin/rm -f $CONTENT_LINK
{% endif %}
logger -p user.notice -t "70-usb-library" -- "$CONTENT_LINK removed."
fi