From c52b3a11342247fa6749cbac6ad974305e45c146 Mon Sep 17 00:00:00 2001 From: tim-moody Date: Wed, 15 Jun 2022 09:58:40 -0400 Subject: [PATCH 1/2] add latest flavor of the month --- vars/local_vars_none.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vars/local_vars_none.yml b/vars/local_vars_none.yml index 86401c167..871068689 100644 --- a/vars/local_vars_none.yml +++ b/vars/local_vars_none.yml @@ -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 From 5cfebd8cc6b7849b0c0f245dc84b65878b69b8ae Mon Sep 17 00:00:00 2001 From: tim-moody Date: Thu, 16 Jun 2022 13:49:50 -0400 Subject: [PATCH 2/2] on usb mount no symlink if rootfs or /library on device --- roles/usb_lib/templates/mount.d/70-usb-library | 18 +++++++++++++++--- .../usb_lib/templates/umount.d/70-usb-library | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/roles/usb_lib/templates/mount.d/70-usb-library b/roles/usb_lib/templates/mount.d/70-usb-library index 11358220d..5b9cfefe8 100644 --- a/roles/usb_lib/templates/mount.d/70-usb-library +++ b/roles/usb_lib/templates/mount.d/70-usb-library @@ -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)}'` diff --git a/roles/usb_lib/templates/umount.d/70-usb-library b/roles/usb_lib/templates/umount.d/70-usb-library index 7803b880f..5af914c01 100644 --- a/roles/usb_lib/templates/umount.d/70-usb-library +++ b/roles/usb_lib/templates/umount.d/70-usb-library @@ -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