1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/usb_lib/templates/iiab-clean-usb.sh
Jerry Vonau daa3deb034 Update roles/usb_lib/templates/iiab-clean-usb.sh
to restore previous search-ability

Co-authored-by: A Holt <holta@users.noreply.github.com>
2025-01-30 13:51:28 -06:00

14 lines
616 B
Bash

#!/bin/bash
# Remove symlink in /library/content to automounted usb drive
#
DEVICE=$(echo $@ | sed -s 's|-|/|')
MNT_POINT=$(findmnt -n /$DEVICE | awk '{print $1}')
CONTENT_LINK_USB=$(basename $MNT_POINT | awk '{print toupper($0)}')
CONTENT_LINK="/library/www/html/local_content/$CONTENT_LINK_USB"
logger -p user.notice -t "usb_lib (iiab-clean-usb.sh)" -- "Attempting to remove link $CONTENT_LINK, as auto-created earlier by usbmount."
if [ -L $CONTENT_LINK ]; then
/bin/rm $CONTENT_LINK
logger -p user.notice -t "usb_lib (iiab-clean-usb.sh)" -- "$CONTENT_LINK removed, as auto-created earlier by usbmount."
fi