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

Merge pull request #3254 from tim-moody/7.3.4-usb-mount

7.3.4 usb mount
This commit is contained in:
Tim Moody 2022-06-16 14:12:43 -04:00 committed by GitHub
commit 2e2824c318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View file

@ -12,7 +12,7 @@
source {{ iiab_env_file }}
case $IIAB_USB_LIB_SHOW_ALL in
'True'|'true'|'TRUE')
logger -p user.notice -t "70-usb-library" -- "Displaying root directory on $UM_MOUNTPOINT."
logger -p user.notice -t "70-usb-library" -- "Display entire USB drive is True. Checking for rootfs or /library on $UM_MOUNTPOINT."
# regularize the variable
IIAB_USB_LIB_SHOW_ALL=True
;;
@ -41,8 +41,20 @@ 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"
UM_DEV=`findmnt $UM_MOUNTPOINT | grep / | awk '{print $2}'`
LIB_DEV=`findmnt /library | grep / | awk '{print $2}' |awk -F '[' '{print $1}'`
ROOT_DEV=`findmnt / | grep / | awk '{print $2}'`
if [ "$UM_DEV" == "$LIB_DEV" ]; then
logger -p user.notice -t "70-usb-library" -- "skipping $UM_MOUNTPOINT containing /library"
#echo "lib on dev"
elif [ "$UM_DEV" == "$ROOT_DEV" ]; then
logger -p user.notice -t "70-usb-library" -- "skipping $UM_MOUNTPOINT containing rootfs"
#echo "rootfs on dev"
else
SHARE_DIR="$UM_MOUNTPOINT"
fi
fi
if [ ! -z "$SHARE_DIR" ]; then
@ -50,7 +62,7 @@ if [ ! -z "$SHARE_DIR" ]; then
else
logger -p user.notice -t "70-usb-library" -- "did not find /share, /Share, /Piratebox/Share, /USB, or /usb on USB"
fi
if [ "$SHARE_DIR" != "" ];then
CONTENT_LINK_USB=`basename $UM_MOUNTPOINT | awk '{print toupper($0)}'`

View file

@ -16,9 +16,9 @@ logger -p user.notice -t "70-usb-library" -- "Attempting to remove link $CONTENT
if [ -L $CONTENT_LINK ]; then
{% if is_debuntu %}
/bin/rm $CONTENT_LINK
/bin/rm -f $CONTENT_LINK
{% else %}
/usr/bin/rm $CONTENT_LINK
/usr/bin/rm -f $CONTENT_LINK
{% endif %}
logger -p user.notice -t "70-usb-library" -- "$CONTENT_LINK removed."
fi

View file

@ -8,4 +8,6 @@ kiwix_enabled: False
osm_vector_maps_install: False
awstats_install: False
awstats_enabled: False
matomo_install: False
matomo_enabled: False
captiveportal_install: False