2020-04-07 16:52:05 +00:00
|
|
|
#!/bin/bash
|
2025-01-31 06:41:23 +00:00
|
|
|
# Remove symlink in /library/www/html/local_content to automounted USB drive
|
|
|
|
|
|
|
|
DEVICE="/$(echo $1 | sed 's|-|/|')"
|
|
|
|
MNT_POINT=$(findmnt -no target $DEVICE)
|
2025-01-26 01:54:32 +00:00
|
|
|
CONTENT_LINK_USB=$(basename $MNT_POINT | awk '{print toupper($0)}')
|
2020-04-07 16:52:05 +00:00
|
|
|
CONTENT_LINK="/library/www/html/local_content/$CONTENT_LINK_USB"
|
2025-01-31 06:41:23 +00:00
|
|
|
|
|
|
|
logger -t "usb_lib (iiab-clean-usb.sh)" "Attempting to remove symlink $CONTENT_LINK, as auto-created earlier by usbmount."
|
2020-04-07 16:52:05 +00:00
|
|
|
|
|
|
|
if [ -L $CONTENT_LINK ]; then
|
2025-01-31 06:41:23 +00:00
|
|
|
/usr/bin/rm $CONTENT_LINK
|
|
|
|
logger -t "usb_lib (iiab-clean-usb.sh)" "Symlink $CONTENT_LINK removed, as auto-created earlier by usbmount."
|
2020-04-07 16:52:05 +00:00
|
|
|
fi
|