1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

move to files

This commit is contained in:
Jerry Vonau 2025-02-15 14:12:37 -06:00
parent 89a42c5003
commit 5b84cd0b87
5 changed files with 12 additions and 16 deletions

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Remove symlink in /library/www/html/local_content to automounted USB drive
# exported
#UM_DEVICE="$DEVNAME"
#UM_MOUNTPOINT="$mountpoint"
#UM_FILESYSTEM="$fstype"
DEVICE="/$(echo $1 | sed 's|-|/|')"
MNT_POINT=$(findmnt -no target $DEVICE)
CONTENT_LINK_USB=$(basename $MNT_POINT | awk '{print toupper($0)}')
#DEVICE="/$(echo $1 | sed 's|-|/|')"
#MNT_POINT=$(findmnt -no target $DEVICE)
CONTENT_LINK_USB=$(basename "$UM_MOUNTPOINT" | awk '{print toupper($0)}')
CONTENT_LINK="/library/www/html/local_content/$CONTENT_LINK_USB"
logger -t "usbmount (iiab-clean-usb.sh)" "Attempting to remove symlink $CONTENT_LINK, as auto-created earlier by usb_lib."

View file

@ -215,15 +215,14 @@ elif [ "$1" = remove ]; then
# If the mountpoint and filesystem type are maintained by
# this script, unmount the filesystem.
if in_list "$mountpoint" "$MOUNTPOINTS"; then
log info "executing command: umount -l $mountpoint"
umount -l "$mountpoint"
# Run hook scripts; ignore errors.
export UM_DEVICE="$DEVNAME"
export UM_MOUNTPOINT="$mountpoint"
export UM_FILESYSTEM="$fstype"
log info "executing command: run-parts /etc/usbmount/umount.d"
run-parts /etc/usbmount/umount.d || :
log info "executing command: umount -l $mountpoint"
umount -l "$mountpoint"
fi
break
fi

View file

@ -93,16 +93,9 @@
with_items:
- { src: 'usbmount/usbmount.conf', dest: '/etc/usbmount/', mode: '0644' }
- { src: 'usbmount/usbmount', dest: '/usr/local/sbin/', mode: '0755' }
- name: 'Install from template: /etc/udev/rules.d/usbmount.rules, /etc/systemd/system/usbmount@.service, /usr/local/sbin/iiab-clean-usb.sh'
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: 'usbmount.rules.j2', dest: '/etc/udev/rules.d/usbmount.rules', mode: '0644' }
- { src: 'usbmount@.service.j2', dest: '/etc/systemd/system/usbmount@.service', mode: '0644' }
- { src: 'iiab-clean-usb.sh', dest: '/usr/local/sbin/', mode: '0755' }
- { src: 'usbmount/usbmount.rules', dest: '/etc/udev/rules.d/usbmount.rules', mode: '0644' }
- { src: 'usbmount/usbmount@.service', dest: '/etc/systemd/system/usbmount@.service', mode: '0644' }
- { src: 'usbmount/iiab-clean-usb.sh', dest: '/etc/usbmount/umount.d/iiab-clean-usb.sh', mode: '0755' }
- name: Add dir {{ doc_root }}/upload2usb (0775) owned by {{ apache_user }}:{{ apache_user }}
file: