mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
nc-automount fixes
This commit is contained in:
parent
bb61bb7c0e
commit
c94bc52dc2
@ -52,18 +52,11 @@ EOF
|
||||
cat > /usr/local/etc/blknum <<'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
OUT=$( lsblk -l )
|
||||
# count all block devices with a file system, except /boot and /root. Start in 0
|
||||
NUM=$(( $( lsblk -l -n -o NAME,FSTYPE | grep -v mmcblk | awk '{ print $2 }' | sed '/^$/d' | wc -l ) - 1 ))
|
||||
|
||||
# partitions, from USB hard drives
|
||||
PARTS=$( grep part <<< "$OUT" | wc -l )
|
||||
|
||||
# removable flash sticks
|
||||
RM=$( awk '{ print $3 }' <<< "$OUT" | grep -c 1 )
|
||||
|
||||
# discount /boot and /root, start at 0
|
||||
RES=$(( RM + PARTS - 3 ))
|
||||
|
||||
[[ $RES > 0 ]] && echo $RES || exit 0
|
||||
# first drive will be USBdrive, second USBdrive1 ...
|
||||
[[ $NUM > 0 ]] && echo $NUM || exit 0
|
||||
|
||||
EOF
|
||||
chmod +x /usr/local/etc/blknum
|
||||
@ -103,6 +96,7 @@ EOF
|
||||
|
||||
[[ "$ACTIVE_" != "yes" ]] && rm -f /etc/udev/rules.d/50-automount.rules
|
||||
|
||||
# mount whatever is currently plugged in
|
||||
udevadm control --reload-rules && udevadm trigger
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# ./installer.sh nc-backup <IP> (<img>)
|
||||
# ./installer.sh nc-backup.sh <IP> (<img>)
|
||||
#
|
||||
# See installer.sh instructions for details
|
||||
#
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# ./installer.sh nc-restore <IP> (<img>)
|
||||
# ./installer.sh nc-restore.sh <IP> (<img>)
|
||||
#
|
||||
# See installer.sh instructions for details
|
||||
#
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user