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

Merge pull request #721 from georgejhunt/usball

usball - show entire USB stick/drive content (at http://box/usb)
This commit is contained in:
georgejhunt 2018-04-05 09:20:08 -07:00 committed by GitHub
commit 9bc9cf9312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 3 deletions

View file

@ -19,9 +19,12 @@
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: 'usbmount@.service.j2' , dest: '/etc/systemd/system/usbmount@.service' }
- { src: 'usbmount.rules.j2' , dest: '/etc/udev/rules.d/usbmount.rules' }
- { src: 'usbmount@.service.j2' , dest: '/etc/systemd/system/usbmount@.service', mode: '0644' }
- { src: 'usbmount.rules.j2' , dest: '/etc/udev/rules.d/usbmount.rules', mode: '0644' }
- { src: 'iiab-usb-lib-show-all-on' , dest: '/usr/bin/', mode: '0755' }
- { src: 'iiab-usb-lib-show-all-off' , dest: '/usr/bin/', mode: '0755' }
- name: Enable exfat and ntfs
lineinfile:
@ -50,6 +53,12 @@
state: absent
when: not usb_lib_enabled
- name: Put a variable in iiab.env for display of content at root of USB
lineinfile:
dest: /etc/iiab/iiab.env
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
- name: Add Apache config for content directory
template:
src: content_dir.conf

View file

@ -0,0 +1,5 @@
#!/bin/bash
# turn on the flag which registers new USB sticks at root directory
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=False/' /etc/iiab/iiab.env

View file

@ -0,0 +1,5 @@
#!/bin/bash
# turn on the flag which registers new USB sticks at root directory
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=True/' /etc/iiab/iiab.env

View file

@ -9,7 +9,17 @@
#
# by Tim Moody tim@timmoody.com
logger -p user.notice -t "70-usb-library" -- "Looking for /share, /Share, /Piratebox/Share, /USB, or /usb on $UM_MOUNTPOINT."
source /etc/iiab/iiab.env
case $IIAB_USB_LIB_SHOW_ALL in
'True'|'true'|'TRUE')
logger -p user.notice -t "70-usb-library" -- "Displaying root directory on $UM_MOUNTPOINT."
# regularize the variable
IIAB_USB_LIB_SHOW_ALL=True
;;
*)
logger -p user.notice -t "70-usb-library" -- "Looking for /share, /Share, /Piratebox/Share, /USB, or /usb on $UM_MOUNTPOINT."
;;
esac
VERBOSE=yes
@ -31,6 +41,9 @@ fi
if [ -d $UM_MOUNTPOINT/usb ]; then
SHARE_DIR="$UM_MOUNTPOINT/usb"
fi
if [ "$IIAB_USB_LIB_SHOW_ALL" == "True" ]; then
SHARE_DIR="$UM_MOUNTPOINT"
fi
if [ ! -z "$SHARE_DIR" ]; then
logger -p user.notice -t "70-usb-library" -- "Found Share Directory $SHARE_DIR."

View file

@ -206,6 +206,7 @@ samba_enabled: False
# usb-lib
usb_lib_install: True
usb_lib_enabled: True
iiab_usb_lib_show_all: False
# Toggle iiab-refresh-wiki-docs scraping for offline docs (http://box/info)
nodocs: False