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:
commit
9bc9cf9312
5 changed files with 36 additions and 3 deletions
|
@ -19,9 +19,12 @@
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'usbmount@.service.j2' , dest: '/etc/systemd/system/usbmount@.service' }
|
- { src: 'usbmount@.service.j2' , dest: '/etc/systemd/system/usbmount@.service', mode: '0644' }
|
||||||
- { src: 'usbmount.rules.j2' , dest: '/etc/udev/rules.d/usbmount.rules' }
|
- { 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
|
- name: Enable exfat and ntfs
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -50,6 +53,12 @@
|
||||||
state: absent
|
state: absent
|
||||||
when: not usb_lib_enabled
|
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
|
- name: Add Apache config for content directory
|
||||||
template:
|
template:
|
||||||
src: content_dir.conf
|
src: content_dir.conf
|
||||||
|
|
5
roles/usb-lib/templates/iiab-usb-lib-show-all-off
Normal file
5
roles/usb-lib/templates/iiab-usb-lib-show-all-off
Normal 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
|
||||||
|
|
5
roles/usb-lib/templates/iiab-usb-lib-show-all-on
Normal file
5
roles/usb-lib/templates/iiab-usb-lib-show-all-on
Normal 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
|
||||||
|
|
|
@ -9,7 +9,17 @@
|
||||||
#
|
#
|
||||||
# by Tim Moody tim@timmoody.com
|
# 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
|
VERBOSE=yes
|
||||||
|
|
||||||
|
@ -31,6 +41,9 @@ fi
|
||||||
if [ -d $UM_MOUNTPOINT/usb ]; then
|
if [ -d $UM_MOUNTPOINT/usb ]; then
|
||||||
SHARE_DIR="$UM_MOUNTPOINT/usb"
|
SHARE_DIR="$UM_MOUNTPOINT/usb"
|
||||||
fi
|
fi
|
||||||
|
if [ "$IIAB_USB_LIB_SHOW_ALL" == "True" ]; then
|
||||||
|
SHARE_DIR="$UM_MOUNTPOINT"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$SHARE_DIR" ]; then
|
if [ ! -z "$SHARE_DIR" ]; then
|
||||||
logger -p user.notice -t "70-usb-library" -- "Found Share Directory $SHARE_DIR."
|
logger -p user.notice -t "70-usb-library" -- "Found Share Directory $SHARE_DIR."
|
||||||
|
|
|
@ -206,6 +206,7 @@ samba_enabled: False
|
||||||
# usb-lib
|
# usb-lib
|
||||||
usb_lib_install: True
|
usb_lib_install: True
|
||||||
usb_lib_enabled: True
|
usb_lib_enabled: True
|
||||||
|
iiab_usb_lib_show_all: False
|
||||||
|
|
||||||
# Toggle iiab-refresh-wiki-docs scraping for offline docs (http://box/info)
|
# Toggle iiab-refresh-wiki-docs scraping for offline docs (http://box/info)
|
||||||
nodocs: False
|
nodocs: False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue